Skip to content

Commit

Permalink
Add missing "LittleFS.begin()" in LittleFS_Timestamp example. (esp826…
Browse files Browse the repository at this point in the history
…6#6762)

* Add missing "LittleFS.begin()"

Add missing first LittleFS.begin() call.

* Update LittleFS_Timestamp.ino
  • Loading branch information
mbm60 authored and devyte committed Nov 14, 2019
1 parent 48ea3a3 commit 95c7407
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,21 +152,25 @@ void setup() {
getLocalTime(&tmstruct, 5000);
Serial.printf("\nNow is : %d-%02d-%02d %02d:%02d:%02d\n", (tmstruct.tm_year) + 1900, (tmstruct.tm_mon) + 1, tmstruct.tm_mday, tmstruct.tm_hour, tmstruct.tm_min, tmstruct.tm_sec);
Serial.println("");

Serial.printf("Formatting LittleFS filesystem\n");
Serial.println("Formatting LittleFS filesystem");
LittleFS.format();
Serial.println("Mount LittleFS");
if (!LittleFS.begin()) {
Serial.println("LittleFS mount failed");
return;
}
listDir("/");
deleteFile("/hello.txt");
writeFile("/hello.txt", "Hello ");
appendFile("/hello.txt", "World!\n");
listDir("/");

Serial.printf("The timestamp should be valid above\n");
Serial.println("The timestamp should be valid above");

Serial.printf("Now unmount and remount and perform the same operation.\n");
Serial.printf("Timestamp should be valid, data should be good.\n");
Serial.println("Now unmount and remount and perform the same operation.");
Serial.println("Timestamp should be valid, data should be good.");
LittleFS.end();
Serial.printf("Now mount it\n");
Serial.println("Now mount it");
if (!LittleFS.begin()) {
Serial.println("LittleFS mount failed");
return;
Expand Down

0 comments on commit 95c7407

Please sign in to comment.