diff --git a/esp32/include/global.h b/esp32/include/global.h index 8494410..5e625d1 100644 --- a/esp32/include/global.h +++ b/esp32/include/global.h @@ -36,3 +36,16 @@ #ifndef I2C_FREQUENCY #define I2C_FREQUENCY 100000UL #endif + +// Optional SD card mounting via SDMMC (1-bit mode for ESP32-S3-CAM) +// Pin definitions - override in build flags if needed +#ifndef SD_CMD_PIN +#define SD_CMD_PIN GPIO_NUM_38 +#endif +#ifndef SD_CLK_PIN +#define SD_CLK_PIN GPIO_NUM_39 +#endif +#ifndef SD_DATA_PIN +#define SD_DATA_PIN GPIO_NUM_40 +#endif + diff --git a/esp32/src/filesystem.cpp b/esp32/src/filesystem.cpp index 376c7c3..4356863 100644 --- a/esp32/src/filesystem.cpp +++ b/esp32/src/filesystem.cpp @@ -137,19 +137,6 @@ bool init() { mkdirRecursive(FS_CONFIG_DIRECTORY); - - // Optional SD card mounting via SDMMC (1-bit mode for ESP32-S3-CAM) - // Pin definitions - override in build flags if needed -#ifndef SD_CMD_PIN -#define SD_CMD_PIN GPIO_NUM_38 -#endif -#ifndef SD_CLK_PIN -#define SD_CLK_PIN GPIO_NUM_39 -#endif -#ifndef SD_DATA_PIN -#define SD_DATA_PIN GPIO_NUM_40 -#endif - esp_vfs_fat_sdmmc_mount_config_t sd_mount_config = { .format_if_mount_failed = false, .max_files = 4, diff --git a/platformio.ini b/platformio.ini index ccbb375..0861456 100644 --- a/platformio.ini +++ b/platformio.ini @@ -54,6 +54,12 @@ build_flags = -D USS_RIGHT_PIN=14 -D SDA_PIN=47 -D SCL_PIN=21 + -D SD_CMD_PIN=GPIO_NUM_38 + -D SD_CLK_PIN=GPIO_NUM_39 + -D SD_DATA_PIN=GPIO_NUM_40 + + + [env:seeed-xiao-esp32s3] platform = espressif32