File tree 1 file changed +23
-0
lines changed
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 12
12
#include < WebHandler.hpp>
13
13
#include < Util.hpp>
14
14
15
+ #include < FS.h>
16
+ #include < LittleFS.h>
17
+
15
18
time_t appStartTime = 0l ;
16
19
char appUptimeBuffer[64 ];
17
20
@@ -71,6 +74,26 @@ void appSetup()
71
74
72
75
Serial.println ();
73
76
77
+ if (LittleFS.begin ())
78
+ {
79
+ if ( !LittleFS.exists ( APP_CONFIG_FILE ))
80
+ {
81
+ LOG0 ( " Config-File <" APP_CONFIG_FILE " > not exists.\n " );
82
+ LOG0 ( " Formatting LittleFS... " );
83
+ LittleFS.format ();
84
+ Serial.println ( " done.\n " );
85
+ File config = LittleFS.open ( APP_CONFIG_FILE, " w" );
86
+ config.write (0 );
87
+ config.close ();
88
+ }
89
+ else
90
+ {
91
+ LOG0 ( " Config-File <" APP_CONFIG_FILE " > found.\n\n " );
92
+ }
93
+
94
+ LittleFS.end ();
95
+ }
96
+
74
97
showChipInfo ();
75
98
76
99
configTime ( TIMEZONE, NTP_SERVER1, NTP_SERVER2, NTP_SERVER3 );
You can’t perform that action at this time.
0 commit comments