From: Ivan Grokhotkov Date: Thu, 17 Aug 2017 16:28:56 +0000 (+0800) Subject: sdmmc: do expect CMD_DONE interrupt after response timeout X-Git-Tag: v3.1-beta1~274^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=20a8c3318a16cebe7b785a0d7dc7a3c52b43b201;p=esp-idf 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. --- 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) {