Reboot after factory reset (#1653)

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
Tom 2022-08-25 17:07:20 +00:00 committed by GitHub
parent 1013aff9b6
commit fd27a40edb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -112,6 +112,13 @@ bool NodeDB::resetRadioConfig()
// Update the global myRegion
initRegion();
if (didFactoryReset) {
config.device.factory_reset = false;
DEBUG_MSG("Rebooting due to factory reset");
screen->startRebootScreen();
rebootAtMsec = millis() + (5 * 1000);
}
return didFactoryReset;
}
@ -122,6 +129,7 @@ bool NodeDB::factoryReset()
rmDir("/prefs");
// second, install default state (this will deal with the duplicate mac address issue)
installDefaultDeviceState();
installDefaultConfig();
// third, write to disk
saveToDisk();
#ifdef ARCH_ESP32