Format config partition if mount failed
This commit is contained in:
parent
e3ded34020
commit
b893257696
@ -20,8 +20,13 @@ void setup()
|
|||||||
|
|
||||||
// Initialize file system
|
// Initialize file system
|
||||||
Serial.print(F("Initialize FS... "));
|
Serial.print(F("Initialize FS... "));
|
||||||
if (!LittleFS.begin()) {
|
if (!LittleFS.begin(false)) { // Do not format if mount failed
|
||||||
Serial.println(F("failed"));
|
Serial.print(F("failed... trying to format..."));
|
||||||
|
if (!LittleFS.begin(true)) {
|
||||||
|
Serial.print("success");
|
||||||
|
} else {
|
||||||
|
Serial.print("failed");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Serial.println(F("done"));
|
Serial.println(F("done"));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user