From fd27a40edb941366a212204731c062a7ac90d48a Mon Sep 17 00:00:00 2001 From: Tom <25043847+Douile@users.noreply.github.com> Date: Thu, 25 Aug 2022 17:07:20 +0000 Subject: [PATCH] Reboot after factory reset (#1653) Co-authored-by: Ben Meadors --- src/mesh/NodeDB.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index f26db75db..19ab81ac9 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -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