From 30196f9430603a3d8a672dd3f0ae5d05b75f2513 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20M=C3=BAdry?= Date: Mon, 27 Jan 2025 03:41:01 +0100 Subject: [PATCH] fix(sdmmc): SDMMC concurrency change active slot only after the slot is initialized Fixes counting of initialized slots --- components/esp_driver_sdmmc/src/sdmmc_host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp_driver_sdmmc/src/sdmmc_host.c b/components/esp_driver_sdmmc/src/sdmmc_host.c index ef10e7f2ef..e306e231c7 100644 --- a/components/esp_driver_sdmmc/src/sdmmc_host.c +++ b/components/esp_driver_sdmmc/src/sdmmc_host.c @@ -413,8 +413,8 @@ esp_err_t sdmmc_host_start_command(int slot, sdmmc_hw_cmd_t cmd, uint32_t arg) // Change the host settings to the appropriate slot before starting the transaction // If the slot is not initialized (slot_host_div not set) or already active, do nothing if (s_host_ctx.active_slot_num != slot) { - s_host_ctx.active_slot_num = slot; if (sdmmc_host_slot_initialized(slot)) { + s_host_ctx.active_slot_num = slot; sdmmc_host_change_to_slot(slot); } else { ESP_LOGD(TAG, "Slot %d is not initialized yet, skipping sdmmc_host_change_to_slot", slot);