sdmmc/sdspi: allow custom setup of SD card frequency

In order to allow flexible setup of SD card frequency, sdmmc_host_t.max_freq_khz is used as a limit

Closes https://github.com/espressif/arduino-esp32/issues/6225
This commit is contained in:
Martin Vychodil
2022-09-12 17:08:36 +02:00
committed by Martin Vychodil
parent 45d1582d09
commit 56f2001317
14 changed files with 195 additions and 50 deletions
+1 -1
View File
@@ -292,7 +292,7 @@ esp_err_t sdmmc_enable_hs_mode_and_check(sdmmc_card_t* card)
return ESP_ERR_NOT_SUPPORTED;
}
card->max_freq_khz = SDMMC_FREQ_HIGHSPEED;
card->max_freq_khz = MIN(card->host.max_freq_khz, SDMMC_FREQ_HIGHSPEED);
return ESP_OK;
}