This repository was archived by the owner on Mar 17, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
examples/Firething_ESP8266 Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,12 @@ void setup() {
36
36
}
37
37
38
38
void loop () {
39
- Serial.println (" ." );
40
39
fire_thing.Loop ();
40
+
41
+ if (i++ % 10 ) {
42
+ Serial.print (" ." );
43
+ }else {
44
+ Serial.println (" ." );
45
+ }
41
46
delay (100 );
42
47
}
Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ Config kDefaultConfig = {
19
19
D0, // config mode button
20
20
};
21
21
22
+ const char kStorageFilename [] = " fthing.cfg" ;
23
+
22
24
} // namespace
23
25
24
26
FireThing::FireThing () : debug_([](const char *) {}) {}
@@ -79,11 +81,11 @@ bool FireThing::ReadConfigFromStorage(Config* config) {
79
81
return false ;
80
82
}
81
83
82
- if (!SPIFFS.exists (" fthing.cfg " )) {
84
+ if (!SPIFFS.exists (kStorageFilename )) {
83
85
debug_ (" Config not found, using default." );
84
86
*config = kDefaultConfig ;
85
87
} else {
86
- File cfg = SPIFFS.open (" fthing.cfg " , " r" );
88
+ File cfg = SPIFFS.open (kStorageFilename , " r" );
87
89
if (!cfg) {
88
90
debug_ (" Failed to open config for read" );
89
91
SPIFFS.end ();
@@ -103,7 +105,7 @@ bool FireThing::WriteConfigToStorage(const Config& config) {
103
105
return false ;
104
106
}
105
107
106
- File cfg = SPIFFS.open (" fthing.cfg " , " w" );
108
+ File cfg = SPIFFS.open (kStorageFilename , " w" );
107
109
if (!cfg) {
108
110
debug_ (" Failed to open config for write" );
109
111
SPIFFS.end ();
You can’t perform that action at this time.
0 commit comments