Re #2681 and #2626: Power off refactoring, the 9XE RTC reset prevention code now active

This commit is contained in:
Damjan Adamic
2015-08-25 20:36:51 +02:00
parent e83b7c3a69
commit 77d3eae4d6
6 changed files with 78 additions and 55 deletions
+3 -8
View File
@@ -1260,12 +1260,7 @@ void alert(const pm_char * t, const pm_char *s MESSAGE_SOUND_ARG)
#if defined(PCBTARANIS) && defined(REV9E)
uint32_t pwr_check = pwrCheck();
if (pwr_check == e_power_off) {
// TODO this is quick & dirty
lcdOff();
BACKLIGHT_OFF();
topLcdOff();
SysTick->CTRL = 0; // turn off systick
pwrOff();
boardOff();
}
else if (pwr_check == e_power_press) {
refresh = true;
@@ -1276,7 +1271,7 @@ void alert(const pm_char * t, const pm_char *s MESSAGE_SOUND_ARG)
}
#else
if (pwrCheck() == e_power_off) {
pwrOff(); // turn power off now
boardOff(); // turn power off now
}
#endif
}
@@ -2577,7 +2572,7 @@ int main(void)
opentxClose();
lcd_clear() ;
lcdRefresh() ;
pwrOff(); // Only turn power off if necessary
boardOff(); // Only turn power off if necessary
wdt_disable();
while(1); // never return from main() - there is no code to return back, if any delays occurs in physical power it does dead loop.
#endif