fix(sdmmc): don't fail in clock update commands when no card detected

Clock update commands don't actually require the card to be present,
so it's not necessary to fail at this stage.
This commit is contained in:
Ivan Grokhotkov
2024-04-05 17:46:27 +02:00
parent 96074470ec
commit b08ddfb25b

View File

@ -348,7 +348,8 @@ esp_err_t sdmmc_host_start_command(int slot, sdmmc_hw_cmd_t cmd, uint32_t arg)
if (!(slot == 0 || slot == 1)) {
return ESP_ERR_INVALID_ARG;
}
if (!sdmmc_ll_is_card_detected(s_host_ctx.hal.dev, slot)) {
// if this isn't a clock update command, check the card detect status
if (!sdmmc_ll_is_card_detected(s_host_ctx.hal.dev, slot) && !cmd.update_clk_reg) {
return ESP_ERR_NOT_FOUND;
}
if (cmd.data_expected && cmd.rw && sdmmc_ll_is_card_write_protected(s_host_ctx.hal.dev, slot)) {