Skip to content

Commit 30196f9

Browse files
committed
fix(sdmmc): SDMMC concurrency change active slot only after the slot is initialized
Fixes counting of initialized slots
1 parent a4a597c commit 30196f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/esp_driver_sdmmc/src/sdmmc_host.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,8 @@ esp_err_t sdmmc_host_start_command(int slot, sdmmc_hw_cmd_t cmd, uint32_t arg)
413413
// Change the host settings to the appropriate slot before starting the transaction
414414
// If the slot is not initialized (slot_host_div not set) or already active, do nothing
415415
if (s_host_ctx.active_slot_num != slot) {
416-
s_host_ctx.active_slot_num = slot;
417416
if (sdmmc_host_slot_initialized(slot)) {
417+
s_host_ctx.active_slot_num = slot;
418418
sdmmc_host_change_to_slot(slot);
419419
} else {
420420
ESP_LOGD(TAG, "Slot %d is not initialized yet, skipping sdmmc_host_change_to_slot", slot);

0 commit comments

Comments
 (0)