diff --git a/Software/src/main.cpp b/Software/src/main.cpp index 4161fcb..d899a3b 100644 --- a/Software/src/main.cpp +++ b/Software/src/main.cpp @@ -46,8 +46,8 @@ U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(-1); void Display_Process(); #endif void Button_Process(); -void toggleWiFiAP(boolean shutdown = false); -void SystemShutdown(); +void toggleWiFiAP(bool shutdown = false); +void SystemShutdown(bool restart = false); uint32_t Process_Impulse_WheelSpeed(); void EEPROMCyclicPDS_callback(); @@ -562,7 +562,7 @@ void Button_Process() } } -void toggleWiFiAP(boolean shutdown) +void toggleWiFiAP(bool shutdown) { if (WiFi.getMode() != WIFI_OFF) { @@ -586,7 +586,7 @@ void toggleWiFiAP(boolean shutdown) } } -void SystemShutdown() +void SystemShutdown(bool restart) { static uint32_t shutdown_delay = 0; @@ -599,7 +599,11 @@ void SystemShutdown() { StoreConfig_EEPROM(); StorePersistence_EEPROM(); - ESP.restart(); + if (restart) + ESP.restart(); + else + while (1) + ; } }