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() {
3636}
3737
3838void loop () {
39- Serial.println (" ." );
4039 fire_thing.Loop ();
40+
41+ if (i++ % 10 ) {
42+ Serial.print (" ." );
43+ }else {
44+ Serial.println (" ." );
45+ }
4146 delay (100 );
4247}
Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ Config kDefaultConfig = {
1919 D0, // config mode button
2020};
2121
22+ const char kStorageFilename [] = " fthing.cfg" ;
23+
2224} // namespace
2325
2426FireThing::FireThing () : debug_([](const char *) {}) {}
@@ -79,11 +81,11 @@ bool FireThing::ReadConfigFromStorage(Config* config) {
7981 return false ;
8082 }
8183
82- if (!SPIFFS.exists (" fthing.cfg " )) {
84+ if (!SPIFFS.exists (kStorageFilename )) {
8385 debug_ (" Config not found, using default." );
8486 *config = kDefaultConfig ;
8587 } else {
86- File cfg = SPIFFS.open (" fthing.cfg " , " r" );
88+ File cfg = SPIFFS.open (kStorageFilename , " r" );
8789 if (!cfg) {
8890 debug_ (" Failed to open config for read" );
8991 SPIFFS.end ();
@@ -103,7 +105,7 @@ bool FireThing::WriteConfigToStorage(const Config& config) {
103105 return false ;
104106 }
105107
106- File cfg = SPIFFS.open (" fthing.cfg " , " w" );
108+ File cfg = SPIFFS.open (kStorageFilename , " w" );
107109 if (!cfg) {
108110 debug_ (" Failed to open config for write" );
109111 SPIFFS.end ();
You can’t perform that action at this time.
0 commit comments