Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit d2fad69

Browse files
committed
minor cleanups
1 parent 702a49b commit d2fad69

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

examples/Firething_ESP8266/Firething_ESP8266.ino

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ void setup() {
3636
}
3737

3838
void 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
}

src/thing/FireThing.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff 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

2426
FireThing::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();

0 commit comments

Comments
 (0)