From 20a8c3318a16cebe7b785a0d7dc7a3c52b43b201 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Fri, 18 Aug 2017 00:28:56 +0800 Subject: [PATCH] sdmmc: do expect CMD_DONE interrupt after response timeout Existing code assumed that response timeout is not followed by CMD_DONE, which was not true, in fact. Host datasheet states that CMD_DONE is sent after an RTO. --- components/driver/sdmmc_transaction.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/components/driver/sdmmc_transaction.c b/components/driver/sdmmc_transaction.c index c62d789140..1e95eada0c 100644 --- a/components/driver/sdmmc_transaction.c +++ b/components/driver/sdmmc_transaction.c @@ -357,15 +357,7 @@ static esp_err_t process_events(sdmmc_event_t evt, sdmmc_command_t* cmd, sdmmc_r case SDMMC_SENDING_CMD: if (mask_check_and_clear(&evt.sdmmc_status, SDMMC_CMD_ERR_MASK)) { process_command_response(orig_evt.sdmmc_status, cmd); - if (cmd->error != ESP_ERR_TIMEOUT) { - // Unless this is a timeout error, we need to wait for the - // CMD_DONE interrupt - break; - } - } - if (!mask_check_and_clear(&evt.sdmmc_status, SDMMC_INTMASK_CMD_DONE) && - cmd->error != ESP_ERR_TIMEOUT) { - break; + break; // Need to wait for the CMD_DONE interrupt } process_command_response(orig_evt.sdmmc_status, cmd); if (cmd->error != ESP_OK || cmd->data == NULL) {