[Taranis X9E] Possibility to shutdown the radio during an ALERT, with
the small animation ...
This commit is contained in:
@@ -176,7 +176,7 @@ void perMain()
|
|||||||
drawStatusLine();
|
drawStatusLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(REV9E) && !defined(SIMU)
|
#if defined(REV9E)
|
||||||
uint32_t pwr_pressed_duration = pwrPressedDuration();
|
uint32_t pwr_pressed_duration = pwrPressedDuration();
|
||||||
if (pwr_pressed_duration > 0) {
|
if (pwr_pressed_duration > 0) {
|
||||||
displayShutdownProgress(pwr_pressed_duration);
|
displayShutdownProgress(pwr_pressed_duration);
|
||||||
|
|||||||
+25
-1
@@ -1169,8 +1169,9 @@ void checkAlarm() // added by Gohst
|
|||||||
if (g_eeGeneral.disableAlarmWarning)
|
if (g_eeGeneral.disableAlarmWarning)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (IS_SOUND_OFF())
|
if (IS_SOUND_OFF()) {
|
||||||
ALERT(STR_ALARMSWARN, STR_ALARMSDISABLED, AU_ERROR);
|
ALERT(STR_ALARMSWARN, STR_ALARMSDISABLED, AU_ERROR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void alert(const pm_char * t, const pm_char *s MESSAGE_SOUND_ARG)
|
void alert(const pm_char * t, const pm_char *s MESSAGE_SOUND_ARG)
|
||||||
@@ -1183,6 +1184,13 @@ void alert(const pm_char * t, const pm_char *s MESSAGE_SOUND_ARG)
|
|||||||
|
|
||||||
if (pwrCheck() == e_power_off) {
|
if (pwrCheck() == e_power_off) {
|
||||||
// the radio has been powered off during the ALERT
|
// the radio has been powered off during the ALERT
|
||||||
|
#if defined(TARANIS) && defined(REV9E)
|
||||||
|
// TODO this is quick & dirty
|
||||||
|
lcdOff();
|
||||||
|
BACKLIGHT_OFF();
|
||||||
|
topLcdOff();
|
||||||
|
SysTick->CTRL = 0; // turn off systick
|
||||||
|
#endif
|
||||||
pwrOff(); // turn power off now
|
pwrOff(); // turn power off now
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1191,6 +1199,22 @@ void alert(const pm_char * t, const pm_char *s MESSAGE_SOUND_ARG)
|
|||||||
checkBacklight();
|
checkBacklight();
|
||||||
|
|
||||||
wdt_reset();
|
wdt_reset();
|
||||||
|
|
||||||
|
#if defined(REV9E)
|
||||||
|
static bool refresh = false;
|
||||||
|
uint32_t pwr_pressed_duration = pwrPressedDuration();
|
||||||
|
if (refresh) {
|
||||||
|
lcdRefresh();
|
||||||
|
refresh = false;
|
||||||
|
if (pwr_pressed_duration == 0) {
|
||||||
|
MESSAGE(t, s, STR_PRESSANYKEY, AU_NONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (pwr_pressed_duration > 0) {
|
||||||
|
displayShutdownProgress(pwr_pressed_duration);
|
||||||
|
refresh = true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1179,6 +1179,7 @@ void lcdRefresh()
|
|||||||
void pwrInit() { }
|
void pwrInit() { }
|
||||||
uint32_t pwrCheck() { return true; }
|
uint32_t pwrCheck() { return true; }
|
||||||
void pwrOff() { }
|
void pwrOff() { }
|
||||||
|
uint32_t pwrPressedDuration() { return 0; }
|
||||||
void usbStart() { }
|
void usbStart() { }
|
||||||
int usbPlugged() { return false; }
|
int usbPlugged() { return false; }
|
||||||
void USART_DeInit(USART_TypeDef* ) { }
|
void USART_DeInit(USART_TypeDef* ) { }
|
||||||
|
|||||||
Reference in New Issue
Block a user