make restart chooseable in SystemShutdown

This commit is contained in:
Marcel Peterkau 2024-01-09 12:15:39 +01:00
parent 16d6aee420
commit e375fab048

View File

@ -46,8 +46,8 @@ U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(-1);
void Display_Process(); void Display_Process();
#endif #endif
void Button_Process(); void Button_Process();
void toggleWiFiAP(boolean shutdown = false); void toggleWiFiAP(bool shutdown = false);
void SystemShutdown(); void SystemShutdown(bool restart = false);
uint32_t Process_Impulse_WheelSpeed(); uint32_t Process_Impulse_WheelSpeed();
void EEPROMCyclicPDS_callback(); void EEPROMCyclicPDS_callback();
@ -562,7 +562,7 @@ void Button_Process()
} }
} }
void toggleWiFiAP(boolean shutdown) void toggleWiFiAP(bool shutdown)
{ {
if (WiFi.getMode() != WIFI_OFF) 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; static uint32_t shutdown_delay = 0;
@ -599,7 +599,11 @@ void SystemShutdown()
{ {
StoreConfig_EEPROM(); StoreConfig_EEPROM();
StorePersistence_EEPROM(); StorePersistence_EEPROM();
ESP.restart(); if (restart)
ESP.restart();
else
while (1)
;
} }
} }