From f557532f7111387ac79d585847c91a0c0628d3ed Mon Sep 17 00:00:00 2001 From: maprad <4398373+maprad@users.noreply.github.com> Date: Fri, 28 Apr 2023 17:36:54 +0200 Subject: [PATCH] don't treat timeout as error in send_cmd_send_op_cond `send_cmd_send_op_cond` allows for multiple retries before `ESP_ERR_TIMEOUT` is returned and a different number of errors that are ignored before the last error is returned. If `ESP_ERR_TIMEOUT` is treated like any other error, the number of retries is limited by the number of errors that can happen. This makes `nretries` useless. --- components/sdmmc/sdmmc_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/sdmmc/sdmmc_cmd.c b/components/sdmmc/sdmmc_cmd.c index 1851a8ca94..a85d648be6 100644 --- a/components/sdmmc/sdmmc_cmd.c +++ b/components/sdmmc/sdmmc_cmd.c @@ -143,7 +143,7 @@ esp_err_t sdmmc_send_cmd_send_op_cond(sdmmc_card_t* card, uint32_t ocr, uint32_t } if (err != ESP_OK) { - if (--err_cnt == 0) { + if (err != ESP_ERR_TIMEOUT && --err_cnt == 0) { ESP_LOGD(TAG, "%s: sdmmc_send_app_cmd err=0x%x", __func__, err); goto done; } else {