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.
pull/13557/merge
Ivan Grokhotkov 2024-04-05 17:46:27 +02:00
rodzic 96074470ec
commit b08ddfb25b
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 1E050E141B280628
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

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