forked from espressif/arduino-esp32
Fix several SD card issues (#4876)
- File might not eval to false if opened with write/append and SD is gone - Allow card to be formatted if FAT partition was not found - Mark card as gone in certain situations - Fix several logic errors in low level SD API
This commit is contained in:
@ -35,7 +35,7 @@ SDMMCFS::SDMMCFS(FSImplPtr impl)
|
||||
: FS(impl), _card(NULL)
|
||||
{}
|
||||
|
||||
bool SDMMCFS::begin(const char * mountpoint, bool mode1bit)
|
||||
bool SDMMCFS::begin(const char * mountpoint, bool mode1bit, bool format_if_mount_failed)
|
||||
{
|
||||
if(_card) {
|
||||
return true;
|
||||
@ -68,7 +68,7 @@ bool SDMMCFS::begin(const char * mountpoint, bool mode1bit)
|
||||
}
|
||||
|
||||
esp_vfs_fat_sdmmc_mount_config_t mount_config = {
|
||||
.format_if_mount_failed = false,
|
||||
.format_if_mount_failed = format_if_mount_failed,
|
||||
.max_files = 5,
|
||||
.allocation_unit_size = 0
|
||||
};
|
||||
|
Reference in New Issue
Block a user