This commit is contained in:
Ben Meadors 2022-08-18 14:21:05 -05:00
parent 1b852a254b
commit fae59fa9c9
5 changed files with 13 additions and 8 deletions

View File

@ -1051,7 +1051,7 @@ int32_t Screen::runOnce()
handleShutdownScreen();
break;
case Cmd::START_REBOOT_SCREEN:
handleShutdownScreen();
handleRebootScreen();
break;
default:
DEBUG_MSG("BUG: invalid cmd\n");

View File

@ -211,11 +211,12 @@ void AdminModule::handleSetConfig(const Config &c)
break;
}
bool didSave = service.reloadConfig();
service.reloadConfig();
// Reboot 5 seconds after a config that requires rebooting is set
if (didSave && requiresReboot) {
rebootAtMsec = millis() + 5 * 1000;
if (requiresReboot) {
DEBUG_MSG("Rebooting due to config changes\n");
screen->startRebootScreen();
rebootAtMsec = millis() + (5 * 1000);
}
}

View File

@ -98,6 +98,7 @@ class NimbleBluetoothServerCallback : public NimBLEServerCallbacks
passkeyShowing = false;
screen->stopBluetoothPinScreen();
}
bluetoothPhoneAPI->setInitalState();
}
virtual void onDisconnect(NimBLEServer* pServer, ble_gap_conn_desc *desc)
@ -127,6 +128,9 @@ bool NimbleBluetooth::isActive()
void NimbleBluetooth::setup()
{
// Uncomment for testing
// NimbleBluetooth::clearBonds();
DEBUG_MSG("Initialise the NimBLE bluetooth module\n");
NimBLEDevice::init(getDeviceName());

View File

@ -209,8 +209,9 @@ void NRF52Bluetooth::shutdown()
void NRF52Bluetooth::setup()
{
Bluefruit.Periph.clearBonds();
Bluefruit.Central.clearBonds();
// Uncomment for testing
// Bluefruit.Periph.clearBonds();
// Bluefruit.Central.clearBonds();
// Initialise the Bluefruit module
DEBUG_MSG("Initialise the Bluefruit nRF52 module\n");

View File

@ -8,7 +8,6 @@ void powerCommandsCheck()
{
if (rebootAtMsec && millis() > rebootAtMsec) {
DEBUG_MSG("Rebooting\n");
screen->startRebootScreen();
#if defined(ARCH_ESP32)
ESP.restart();
#elif defined(ARCH_NRF52)