Skip to content

Added maxOpenFiles to SDMMC #6912

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libraries/SD_MMC/src/SD_MMC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ bool SDMMCFS::setPins(int clk, int cmd, int d0, int d1, int d2, int d3)
#endif
}

bool SDMMCFS::begin(const char * mountpoint, bool mode1bit, bool format_if_mount_failed, int sdmmc_frequency)
bool SDMMCFS::begin(const char * mountpoint, bool mode1bit, bool format_if_mount_failed, int sdmmc_frequency, uint8_t maxOpenFiles)
{
if(_card) {
return true;
Expand Down Expand Up @@ -122,7 +122,7 @@ bool SDMMCFS::begin(const char * mountpoint, bool mode1bit, bool format_if_mount

esp_vfs_fat_sdmmc_mount_config_t mount_config = {
.format_if_mount_failed = format_if_mount_failed,
.max_files = 5,
.max_files = maxOpenFiles,
.allocation_unit_size = 0
};

Expand Down
2 changes: 1 addition & 1 deletion libraries/SD_MMC/src/SD_MMC.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class SDMMCFS : public FS
SDMMCFS(FSImplPtr impl);
bool setPins(int clk, int cmd, int d0);
bool setPins(int clk, int cmd, int d0, int d1, int d2, int d3);
bool begin(const char * mountpoint="/sdcard", bool mode1bit=false, bool format_if_mount_failed=false, int sdmmc_frequency=BOARD_MAX_SDMMC_FREQ);
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);
void end();
sdcard_type_t cardType();
uint64_t cardSize();
Expand Down