Skip to content

Commit 9c8f8c6

Browse files
committed
Rename 'doSerializeConfig' to 'configNeedsWrite'
Clarify the name and usage of this flag, as the function name has changed out from underneath it.
1 parent e21a09c commit 9c8f8c6

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

wled00/cfg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ void serializeConfigToFS() {
704704
f.close();
705705
releaseJSONBufferLock();
706706

707-
doSerializeConfig = false;
707+
configNeedsWrite = false;
708708
}
709709

710710
void serializeConfig(JsonObject root) {

wled00/dmx_input.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ void rdmPersonalityChangedCb(dmx_port_t dmxPort, const rdm_header_t *header,
2222
if (header->cc == RDM_CC_SET_COMMAND_RESPONSE) {
2323
const uint8_t personality = dmx_get_current_personality(dmx->inputPortNum);
2424
DMXMode = std::min(DMX_MODE_PRESET, std::max(DMX_MODE_SINGLE_RGB, int(personality)));
25-
doSerializeConfig = true;
25+
configNeedsWrite = true;
2626
DEBUG_PRINTF("DMX personality changed to to: %d\n", DMXMode);
2727
}
2828
}
@@ -40,7 +40,7 @@ void rdmAddressChangedCb(dmx_port_t dmxPort, const rdm_header_t *header,
4040
if (header->cc == RDM_CC_SET_COMMAND_RESPONSE) {
4141
const uint16_t addr = dmx_get_start_address(dmx->inputPortNum);
4242
DMXAddress = std::min(512, int(addr));
43-
doSerializeConfig = true;
43+
configNeedsWrite = true;
4444
DEBUG_PRINTF("DMX start addr changed to: %d\n", DMXAddress);
4545
}
4646
}

wled00/presets.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ void savePreset(byte index, const char* pname, JsonObject sObj)
242242
if (!sObj[FPSTR(bootPS)].isNull()) {
243243
bootPreset = sObj[FPSTR(bootPS)] | bootPreset;
244244
sObj.remove(FPSTR(bootPS));
245-
doSerializeConfig = true;
245+
configNeedsWrite = true;
246246
}
247247

248248
if (sObj.size()==0 || sObj["o"].isNull()) { // no "o" means not a playlist or custom API call, saving of state is async (not immediately)

wled00/set.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -805,8 +805,8 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
805805

806806
lastEditTime = millis();
807807
// do not save if factory reset or LED settings (which are saved after LED re-init)
808-
doSerializeConfig = subPage != SUBPAGE_LEDS && !(subPage == SUBPAGE_SEC && doReboot);
809-
if (subPage == SUBPAGE_UM) doReboot = request->hasArg(F("RBT")); // prevent race condition on dual core system (set reboot here, after doSerializeConfig has been set)
808+
configNeedsWrite = subPage != SUBPAGE_LEDS && !(subPage == SUBPAGE_SEC && doReboot);
809+
if (subPage == SUBPAGE_UM) doReboot = request->hasArg(F("RBT")); // prevent race condition on dual core system (set reboot here, after configNeedsWrite has been set)
810810
#ifndef WLED_DISABLE_ALEXA
811811
if (subPage == SUBPAGE_SYNC) alexaInit();
812812
#endif

wled00/wled.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,14 +193,14 @@ void WLED::loop()
193193
if (aligned) strip.makeAutoSegments();
194194
else strip.fixInvalidSegments();
195195
BusManager::setBrightness(bri); // fix re-initialised bus' brightness
196-
doSerializeConfig = true;
196+
configNeedsWrite = true;
197197
}
198198
if (loadLedmap >= 0) {
199199
strip.deserializeMap(loadLedmap);
200200
loadLedmap = -1;
201201
}
202202
yield();
203-
if (doSerializeConfig) serializeConfigToFS();
203+
if (configNeedsWrite) serializeConfigToFS();
204204

205205
yield();
206206
handleWs();
@@ -223,7 +223,7 @@ void WLED::loop()
223223
}
224224
#endif
225225

226-
if (doReboot && (!doInitBusses || !doSerializeConfig)) // if busses have to be inited & saved, wait until next iteration
226+
if (doReboot && (!doInitBusses || !configNeedsWrite)) // if busses have to be inited & saved, wait until next iteration
227227
reset();
228228

229229
// DEBUG serial logging (every 30s)

wled00/wled.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ WLED_GLOBAL byte errorFlag _INIT(0);
877877
WLED_GLOBAL String messageHead, messageSub;
878878
WLED_GLOBAL byte optionType;
879879

880-
WLED_GLOBAL bool doSerializeConfig _INIT(false); // flag to initiate saving of config
880+
WLED_GLOBAL bool configNeedsWrite _INIT(false); // flag to initiate saving of config
881881
WLED_GLOBAL bool doReboot _INIT(false); // flag to initiate reboot from async handlers
882882

883883
WLED_GLOBAL bool psramSafe _INIT(true); // is it safe to use PSRAM (on ESP32 rev.1; compiler fix used "-mfix-esp32-psram-cache-issue")

wled00/wled_server.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ void initServer()
328328
interfaceUpdateCallMode = CALL_MODE_WS_SEND; // schedule WS update
329329
serveJson(request); return; //if JSON contains "v"
330330
} else {
331-
doSerializeConfig = true; //serializeConfig(); //Save new settings to FS
331+
configNeedsWrite = true; //Save new settings to FS
332332
}
333333
}
334334
request->send(200, CONTENT_TYPE_JSON, F("{\"success\":true}"));

0 commit comments

Comments
 (0)