Fix bootloop if config is reset (#4852)
* Fix bootloop if config missing/reset Can't reset the config if there's nothing to reset! * ESP8266: Commit ACTIONT_TRACKER * Use consistent naming for backups and reset cfgs Use 'rst.cfg.json' instead of 'cfg.json.rst.json' for configs that were reset. * Add a little more PSTR to bootloop handling
This commit is contained in:
@@ -787,13 +787,15 @@ bool verifyConfig() {
|
||||
}
|
||||
|
||||
// rename config file and reboot
|
||||
// if the cfg 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];
|
||||
snprintf_P(backupname, sizeof(backupname), PSTR("/rst.%s"), &s_cfg_json[1]);
|
||||
WLED_FS.rename(s_cfg_json, backupname);
|
||||
doReboot = true;
|
||||
}
|
||||
}
|
||||
|
||||
bool deserializeConfigFromFS() {
|
||||
|
||||
Reference in New Issue
Block a user