mirror of
https://github.com/wled/WLED.git
synced 2025-07-11 21:06:32 +00:00
Fix for #4752
This commit is contained in:
parent
7b0075d375
commit
fc0d64ec78
@ -775,7 +775,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
|
|||||||
|
|
||||||
static const char s_cfg_json[] PROGMEM = "/cfg.json";
|
static const char s_cfg_json[] PROGMEM = "/cfg.json";
|
||||||
|
|
||||||
void deserializeConfigFromFS() {
|
bool deserializeConfigFromFS() {
|
||||||
[[maybe_unused]] bool success = deserializeConfigSec();
|
[[maybe_unused]] bool success = deserializeConfigSec();
|
||||||
#ifdef WLED_ADD_EEPROM_SUPPORT
|
#ifdef WLED_ADD_EEPROM_SUPPORT
|
||||||
if (!success) { //if file does not exist, try reading from EEPROM
|
if (!success) { //if file does not exist, try reading from EEPROM
|
||||||
@ -783,7 +783,7 @@ void deserializeConfigFromFS() {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!requestJSONBufferLock(1)) return;
|
if (!requestJSONBufferLock(1)) return false;
|
||||||
|
|
||||||
DEBUG_PRINTLN(F("Reading settings from /cfg.json..."));
|
DEBUG_PRINTLN(F("Reading settings from /cfg.json..."));
|
||||||
|
|
||||||
@ -795,7 +795,7 @@ void deserializeConfigFromFS() {
|
|||||||
bool needsSave = deserializeConfig(root, true);
|
bool needsSave = deserializeConfig(root, true);
|
||||||
releaseJSONBufferLock();
|
releaseJSONBufferLock();
|
||||||
|
|
||||||
if (needsSave) serializeConfigToFS(); // usermods required new parameters
|
return needsSave;
|
||||||
}
|
}
|
||||||
|
|
||||||
void serializeConfigToFS() {
|
void serializeConfigToFS() {
|
||||||
|
@ -25,7 +25,7 @@ void IRAM_ATTR touchButtonISR();
|
|||||||
|
|
||||||
//cfg.cpp
|
//cfg.cpp
|
||||||
bool deserializeConfig(JsonObject doc, bool fromFS = false);
|
bool deserializeConfig(JsonObject doc, bool fromFS = false);
|
||||||
void deserializeConfigFromFS();
|
bool deserializeConfigFromFS();
|
||||||
bool deserializeConfigSec();
|
bool deserializeConfigSec();
|
||||||
void serializeConfig(JsonObject doc);
|
void serializeConfig(JsonObject doc);
|
||||||
void serializeConfigToFS();
|
void serializeConfigToFS();
|
||||||
|
@ -423,7 +423,7 @@ void WLED::setup()
|
|||||||
multiWiFi.push_back(WiFiConfig(CLIENT_SSID,CLIENT_PASS)); // initialise vector with default WiFi
|
multiWiFi.push_back(WiFiConfig(CLIENT_SSID,CLIENT_PASS)); // initialise vector with default WiFi
|
||||||
|
|
||||||
DEBUG_PRINTLN(F("Reading config"));
|
DEBUG_PRINTLN(F("Reading config"));
|
||||||
deserializeConfigFromFS();
|
bool needsCfgSave = deserializeConfigFromFS();
|
||||||
DEBUG_PRINTF_P(PSTR("heap %u\n"), ESP.getFreeHeap());
|
DEBUG_PRINTF_P(PSTR("heap %u\n"), ESP.getFreeHeap());
|
||||||
|
|
||||||
#if defined(STATUSLED) && STATUSLED>=0
|
#if defined(STATUSLED) && STATUSLED>=0
|
||||||
@ -443,6 +443,8 @@ void WLED::setup()
|
|||||||
UsermodManager::setup();
|
UsermodManager::setup();
|
||||||
DEBUG_PRINTF_P(PSTR("heap %u\n"), ESP.getFreeHeap());
|
DEBUG_PRINTF_P(PSTR("heap %u\n"), ESP.getFreeHeap());
|
||||||
|
|
||||||
|
if (needsCfgSave) serializeConfigToFS(); // usermods required new parameters; need to wait for strip to be initialised #4752
|
||||||
|
|
||||||
if (strcmp(multiWiFi[0].clientSSID, DEFAULT_CLIENT_SSID) == 0)
|
if (strcmp(multiWiFi[0].clientSSID, DEFAULT_CLIENT_SSID) == 0)
|
||||||
showWelcomePage = true;
|
showWelcomePage = true;
|
||||||
WiFi.persistent(false);
|
WiFi.persistent(false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user