Skip to content

Commit a3968f4

Browse files
committed
feat(sdmmc): Toggle power pin if defined
1 parent f533457 commit a3968f4

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

libraries/SD_MMC/src/SD_MMC.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,12 @@ bool SDMMCFS::begin(const char *mountpoint, bool mode1bit, bool format_if_mount_
257257
host.pwr_ctrl_handle = pwr_ctrl_handle;
258258
#endif
259259

260+
#if defined(BOARD_SDMMC_POWER_PIN)
261+
pinMode(BOARD_SDMMC_POWER_PIN, OUTPUT);
262+
digitalWrite(BOARD_SDMMC_POWER_PIN, HIGH);
263+
perimanSetPinBusExtraType(BOARD_SDMMC_POWER_PIN, "SDMMC_POWER");
264+
#endif
265+
260266
esp_vfs_fat_sdmmc_mount_config_t mount_config = {
261267
.format_if_mount_failed = format_if_mount_failed,
262268
.max_files = maxOpenFiles,

variants/esp32p4/pins_arduino.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ static const uint8_t T13 = 15;
6969
#define BOARD_HAS_SDMMC
7070
#define BOARD_SDMMC_SLOT 0
7171
#define BOARD_SDMMC_POWER_CHANNEL 4
72-
#define BOARD_SDMMC_POWER_PIN 43
72+
#define BOARD_SDMMC_POWER_PIN 45
7373

7474
//WIFI - ESP32C6
7575
#define BOARD_HAS_SDIO_ESP_HOSTED

0 commit comments

Comments
 (0)