From 40e64ddb03524661d078c1a4382923ff2bc024a5 Mon Sep 17 00:00:00 2001 From: cyberman54 Date: Mon, 31 Oct 2022 16:19:56 +0100 Subject: [PATCH] sdcard add generic slotconfig --- include/sdcard.h | 4 ++++ src/sdcard.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/sdcard.h b/include/sdcard.h index 1f2b0bca..4b1145eb 100644 --- a/include/sdcard.h +++ b/include/sdcard.h @@ -33,6 +33,10 @@ #elif HAS_SDCARD == 2 // MMC interface #include "driver/sdmmc_host.h" +#ifndef SDCARD_SLOTCONFIG +#define SDCARD_SLOTCONFIG SDMMC_SLOT_CONFIG_DEFAULT() +#endif + #ifndef SDCARD_SLOTWIDTH #define SDCARD_SLOTWIDTH 1 #endif diff --git a/src/sdcard.cpp b/src/sdcard.cpp index d4c23e46..54414233 100644 --- a/src/sdcard.cpp +++ b/src/sdcard.cpp @@ -132,7 +132,7 @@ bool sdcard_init(bool create) { // has these signals. // Default config for SDMMC_HOST_DEFAULT (4-bit bus width, slot 1) // https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/sdmmc_host.html - sdmmc_slot_config_t slot_config = SDMMC_SLOT_CONFIG_DEFAULT(); + sdmmc_slot_config_t slot_config = SDCARD_SLOTCONFIG; // Set 1-line or 4-line SD mode (default is 1-line) slot_config.width = SDCARD_SLOTWIDTH;