move the factory reset stuff above the ble bonds

This commit is contained in:
Mike Kinney 2022-03-17 18:08:39 +00:00
parent 67bc6b1419
commit d57ac39b02

View File

@ -97,6 +97,13 @@ bool NodeDB::resetRadioConfig()
nvs_flash_erase();
#endif
#ifdef NRF52_SERIES
installDefaultDeviceState();
installDefaultRadioConfig();
installDefaultChannels();
saveToDisk();
saveChannelsToDisk();
Bluefruit.begin();
DEBUG_MSG("Clearing bluetooth bonds!\n");
@ -106,11 +113,6 @@ bool NodeDB::resetRadioConfig()
Bluefruit.Periph.clearBonds();
Bluefruit.Central.clearBonds();
installDefaultDeviceState();
installDefaultRadioConfig();
installDefaultChannels();
saveToDisk();
saveChannelsToDisk();
#endif
didFactoryReset = true;