Skip to content

Commit 773e0a8

Browse files
committed
feat(sdmmc): Check if power channel is specified
1 parent 3ff5492 commit 773e0a8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: libraries/SD_MMC/src/SD_MMC.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,9 @@ bool SDMMCFS::begin(const char *mountpoint, bool mode1bit, bool format_if_mount_
247247
_mode1bit = mode1bit;
248248

249249
#ifdef SOC_SDMMC_IO_POWER_EXTERNAL
250+
if(_power_channel == -1) {
251+
log_i("On-chip power channel specified, use external power for SDMMC");
252+
} else {
250253
sd_pwr_ctrl_ldo_config_t ldo_config = {
251254
.ldo_chan_id = _power_channel,
252255
};
@@ -257,6 +260,7 @@ bool SDMMCFS::begin(const char *mountpoint, bool mode1bit, bool format_if_mount_
257260
return false;
258261
}
259262
host.pwr_ctrl_handle = pwr_ctrl_handle;
263+
}
260264
#endif
261265

262266
#if defined(BOARD_SDMMC_POWER_PIN)

0 commit comments

Comments
 (0)