mount FS after format - to avoid to restart board

This commit is contained in:
Luc 2021-03-07 12:56:51 +01:00
parent eb632b70c0
commit 7a7ac8f20b
5 changed files with 25 additions and 5 deletions

View File

@ -70,7 +70,11 @@ const char * ESP_FileSystem::FilesystemName()
bool ESP_FileSystem::format()
{
return FFat.format();
bool res = FFat.format();
if (res){
res = begin();
}
return res;
}
ESP_File ESP_FileSystem::open(const char* path, uint8_t mode)

View File

@ -70,7 +70,11 @@ const char * ESP_FileSystem::FilesystemName()
bool ESP_FileSystem::format()
{
return LITTLEFS.format();
bool res = LITTLEFS.format();
if (res){
res = begin();
}
return res;
}
ESP_File ESP_FileSystem::open(const char* path, uint8_t mode)

View File

@ -74,7 +74,11 @@ const char * ESP_FileSystem::FilesystemName()
bool ESP_FileSystem::format()
{
return LittleFS.format();
bool res = LittleFS.format();
if (res){
res = begin();
}
return res;
}
ESP_File ESP_FileSystem::open(const char* path, uint8_t mode)

View File

@ -68,7 +68,11 @@ const char * ESP_FileSystem::FilesystemName()
bool ESP_FileSystem::format()
{
return SPIFFS.format();
bool res = SPIFFS.format();
if (res){
res = begin();
}
return res;
}
ESP_File ESP_FileSystem::open(const char* path, uint8_t mode)

View File

@ -72,7 +72,11 @@ const char * ESP_FileSystem::FilesystemName()
bool ESP_FileSystem::format()
{
return SPIFFS.format();
bool res = SPIFFS.format();
if (res){
res = begin();
}
return res;
}
ESP_File ESP_FileSystem::open(const char* path, uint8_t mode)