Skip to content

Commit 95c7407

Browse files
mbm60devyte
authored andcommitted
Add missing "LittleFS.begin()" in LittleFS_Timestamp example. (#6762)
* Add missing "LittleFS.begin()" Add missing first LittleFS.begin() call. * Update LittleFS_Timestamp.ino
1 parent 48ea3a3 commit 95c7407

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

libraries/LittleFS/examples/LittleFS_Timestamp/LittleFS_Timestamp.ino

+10-6
Original file line numberDiff line numberDiff line change
@@ -152,21 +152,25 @@ void setup() {
152152
getLocalTime(&tmstruct, 5000);
153153
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);
154154
Serial.println("");
155-
156-
Serial.printf("Formatting LittleFS filesystem\n");
155+
Serial.println("Formatting LittleFS filesystem");
157156
LittleFS.format();
157+
Serial.println("Mount LittleFS");
158+
if (!LittleFS.begin()) {
159+
Serial.println("LittleFS mount failed");
160+
return;
161+
}
158162
listDir("/");
159163
deleteFile("/hello.txt");
160164
writeFile("/hello.txt", "Hello ");
161165
appendFile("/hello.txt", "World!\n");
162166
listDir("/");
163167

164-
Serial.printf("The timestamp should be valid above\n");
168+
Serial.println("The timestamp should be valid above");
165169

166-
Serial.printf("Now unmount and remount and perform the same operation.\n");
167-
Serial.printf("Timestamp should be valid, data should be good.\n");
170+
Serial.println("Now unmount and remount and perform the same operation.");
171+
Serial.println("Timestamp should be valid, data should be good.");
168172
LittleFS.end();
169-
Serial.printf("Now mount it\n");
173+
Serial.println("Now mount it");
170174
if (!LittleFS.begin()) {
171175
Serial.println("LittleFS mount failed");
172176
return;

0 commit comments

Comments
 (0)