fix(sdmmc): Improve SD card state checking after write/read command

This commit is contained in:
Adam Múdry
2024-10-15 22:28:26 +02:00
committed by BOT
parent 5c627d9d18
commit a44a659b0f
3 changed files with 11 additions and 5 deletions

View File

@@ -268,8 +268,8 @@ esp_err_t sdmmc_init_mmc_check_ext_csd(sdmmc_card_t* card)
ESP_LOGE(TAG, "%s: send_status returned 0x%x", __func__, err);
goto out;
}
status = ((status & MMC_R1_CURRENT_STATE_MASK) >> MMC_R1_CURRENT_STATE_POS);
if (status != MMC_R1_CURRENT_STATE_TRAN) {
if (MMC_R1_CURRENT_STATE_STATUS(status) != MMC_R1_CURRENT_STATE_TRAN) {
ESP_LOGE(TAG, "%s: card not in transfer state", __func__);
err = ESP_ERR_INVALID_STATE;
goto out;