mirror of
https://github.com/wled/WLED.git
synced 2026-04-20 14:12:55 +00:00
Fix bootloop if config missing/reset
Can't reset the config if there's nothing to reset!
This commit is contained in:
@@ -651,13 +651,16 @@ bool verifyConfig() {
|
||||
}
|
||||
|
||||
// rename config file and reboot
|
||||
// if the file doesn't exist, such as after a reset, do nothing
|
||||
void resetConfig() {
|
||||
DEBUG_PRINTLN(F("Reset config"));
|
||||
char backupname[32];
|
||||
strcpy(backupname, s_cfg_json);
|
||||
strcat(backupname, ".rst.json");
|
||||
WLED_FS.rename(s_cfg_json, backupname);
|
||||
doReboot = true;
|
||||
if (WLED_FS.exists(s_cfg_json)) {
|
||||
DEBUG_PRINTLN(F("Reset config"));
|
||||
char backupname[32];
|
||||
strcpy(backupname, s_cfg_json);
|
||||
strcat(backupname, ".rst.json");
|
||||
WLED_FS.rename(s_cfg_json, backupname);
|
||||
doReboot = true;
|
||||
}
|
||||
}
|
||||
|
||||
bool deserializeConfigFromFS() {
|
||||
|
||||
Reference in New Issue
Block a user