Skip to content

Commit b333d4c

Browse files
committed
feat(sd_mmc): Make UHS-I SDR the default for ESP-P4 SD_MMC
1 parent d39181b commit b333d4c

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

libraries/SD_MMC/src/SD_MMC.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,10 @@ bool SDMMCFS::begin(const char *mountpoint, bool mode1bit, bool format_if_mount_
246246
.width = 4,
247247
.flags = 0,
248248
};
249+
#ifdef SOC_SDMMC_UHS_I_SUPPORTED
250+
host.flags &= ~SDMMC_HOST_FLAG_DDR;
251+
slot_config.flags = SDMMC_SLOT_FLAG_UHS1;
252+
#endif
249253
#else
250254
host.slot = SDMMC_HOST_SLOT_1;
251255
#endif

libraries/SD_MMC/src/SD_MMC.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,12 @@
3030
// you can define BOARD_MAX_SDMMC_FREQ with lower value (Ex. SDMMC_FREQ_DEFAULT)
3131
// in pins_arduino.h for your board variant.
3232
#ifndef BOARD_MAX_SDMMC_FREQ
33+
#ifdef SOC_SDMMC_UHS_I_SUPPORTED
34+
#define BOARD_MAX_SDMMC_FREQ SDMMC_FREQ_SDR50
35+
#else
3336
#define BOARD_MAX_SDMMC_FREQ SDMMC_FREQ_HIGHSPEED
3437
#endif
38+
#endif
3539

3640
namespace fs {
3741

0 commit comments

Comments
 (0)