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.
This commit is contained in:
maprad 2023-04-28 17:36:54 +02:00 committed by GitHub
parent 56123c52aa
commit f557532f71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {