changed Reset via Buttons during Startup
This commit is contained in:
parent
ec62eeee1e
commit
97cdd7fad1
@ -13,7 +13,7 @@
|
||||
#define HOST_NAME "AirsoftTimer_%08X"
|
||||
|
||||
#define SHUTDOWN_DELAY_MS 5000
|
||||
#define RESETABLE_AFTER_STARTUP_MS 30000
|
||||
#define STARTUP_DELAY_MS 20000
|
||||
|
||||
#define GPIO_LORA_TX D3
|
||||
#define GPIO_LORA_RX D4
|
||||
|
@ -236,8 +236,26 @@ void loop()
|
||||
#ifdef FEATURE_ENABLE_WIFI_CLIENT
|
||||
tmrWiFiMaintainConnection.update();
|
||||
#endif
|
||||
if (globals.systemStatus == sysStat_Shutdown)
|
||||
|
||||
switch (globals.systemStatus)
|
||||
{
|
||||
case sysStat_Error:
|
||||
/* code */
|
||||
break;
|
||||
case sysStat_Normal:
|
||||
/* code */
|
||||
break;
|
||||
case sysStat_Shutdown:
|
||||
SystemShutdown();
|
||||
break;
|
||||
case sysStat_Startup:
|
||||
if (millis() > STARTUP_DELAY_MS)
|
||||
globals.systemStatus = sysStat_Normal;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
yield();
|
||||
}
|
||||
@ -565,7 +583,7 @@ void ProcessKeyCombos(bool *btnState)
|
||||
else if (keyCount_Fac2 == 4 && keyCount_Fac3 == 0)
|
||||
{
|
||||
Serial.printf("KeyCombo: Reset Timer\n");
|
||||
if (millis() < RESETABLE_AFTER_STARTUP_MS)
|
||||
if (globals.systemStatus == sysStat_Startup)
|
||||
{
|
||||
OverrideDisplay("RST ", 5000);
|
||||
PersistenceData.faction_1_timer = 0;
|
||||
@ -577,7 +595,7 @@ void ProcessKeyCombos(bool *btnState)
|
||||
else
|
||||
{
|
||||
OverrideDisplay("ERR ", 5000);
|
||||
Serial.printf("ERROR: only %d seconds after Startup!\n", RESETABLE_AFTER_STARTUP_MS / 1000);
|
||||
Serial.printf("ERROR: only %d seconds after Startup!\n", STARTUP_DELAY_MS / 1000);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user