Beeps on THR and SWITCH alerts
This commit is contained in:
+12
-8
@@ -741,19 +741,12 @@ void checkSwitches()
|
|||||||
{
|
{
|
||||||
if(!g_eeGeneral.switchWarning) return; // if warning is on
|
if(!g_eeGeneral.switchWarning) return; // if warning is on
|
||||||
|
|
||||||
// first - display warning
|
|
||||||
message(STR_ALERT, STR_SWITCHESNOTOFF, STR_RESETTHROTTLE, STR_PLEASERESETTHEM);
|
|
||||||
|
|
||||||
bool state = (g_eeGeneral.switchWarning > 0);
|
bool state = (g_eeGeneral.switchWarning > 0);
|
||||||
|
bool first = true;
|
||||||
|
|
||||||
//loop until all switches are reset
|
//loop until all switches are reset
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
#ifdef SIMU
|
|
||||||
if (!main_thread_running) return;
|
|
||||||
sleep(1/*ms*/);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
uint8_t i;
|
uint8_t i;
|
||||||
for(i=SW_BASE; i<SW_Trainer; i++)
|
for(i=SW_BASE; i<SW_Trainer; i++)
|
||||||
{
|
{
|
||||||
@@ -762,7 +755,18 @@ void checkSwitches()
|
|||||||
}
|
}
|
||||||
if(i==SW_Trainer || keyDown()) return;
|
if(i==SW_Trainer || keyDown()) return;
|
||||||
|
|
||||||
|
// first - display warning
|
||||||
|
if (first) {
|
||||||
|
message(STR_ALERT, STR_SWITCHESNOTOFF, STR_RESETTHROTTLE, STR_PLEASERESETTHEM);
|
||||||
|
first = false;
|
||||||
|
}
|
||||||
|
|
||||||
checkBacklight();
|
checkBacklight();
|
||||||
|
|
||||||
|
#ifdef SIMU
|
||||||
|
if (!main_thread_running) return;
|
||||||
|
sleep(1/*ms*/);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user