Skip to content

Commit 43e5e02

Browse files
authored
Added maxOpenFiles to SDMMC (#6912)
1 parent 097ff8b commit 43e5e02

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ bool SDMMCFS::setPins(int clk, int cmd, int d0, int d1, int d2, int d3)
8484
#endif
8585
}
8686

87-
bool SDMMCFS::begin(const char * mountpoint, bool mode1bit, bool format_if_mount_failed, int sdmmc_frequency)
87+
bool SDMMCFS::begin(const char * mountpoint, bool mode1bit, bool format_if_mount_failed, int sdmmc_frequency, uint8_t maxOpenFiles)
8888
{
8989
if(_card) {
9090
return true;
@@ -122,7 +122,7 @@ bool SDMMCFS::begin(const char * mountpoint, bool mode1bit, bool format_if_mount
122122

123123
esp_vfs_fat_sdmmc_mount_config_t mount_config = {
124124
.format_if_mount_failed = format_if_mount_failed,
125-
.max_files = 5,
125+
.max_files = maxOpenFiles,
126126
.allocation_unit_size = 0
127127
};
128128

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class SDMMCFS : public FS
5050
SDMMCFS(FSImplPtr impl);
5151
bool setPins(int clk, int cmd, int d0);
5252
bool setPins(int clk, int cmd, int d0, int d1, int d2, int d3);
53-
bool begin(const char * mountpoint="/sdcard", bool mode1bit=false, bool format_if_mount_failed=false, int sdmmc_frequency=BOARD_MAX_SDMMC_FREQ);
53+
bool begin(const char * mountpoint="/sdcard", bool mode1bit=false, bool format_if_mount_failed=false, int sdmmc_frequency=BOARD_MAX_SDMMC_FREQ, uint8_t maxOpenFiles = 5);
5454
void end();
5555
sdcard_type_t cardType();
5656
uint64_t cardSize();

0 commit comments

Comments
 (0)