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
+20 -1
View File
@@ -187,7 +187,7 @@ void boardInit()
lcdRefreshWait();
}
if (duration < PWR_PRESS_DURATION_MIN || duration >= PWR_PRESS_DURATION_MAX) {
pwrOff();
boardOff();
}
}
else {
@@ -198,8 +198,27 @@ void boardInit()
backlightInit();
#endif
}
void boardOff()
{
BACKLIGHT_OFF();
#if defined(REV9E)
topLcdOff();
#endif
#if defined(REV9E)
while (pwrPressed()) {
wdt_reset();
}
#endif
lcdOff();
SysTick->CTRL = 0; // turn off systick
pwrOff();
}
#endif // #if !defined(SIMU)
#if defined(USB_JOYSTICK) && !defined(SIMU)
extern USB_OTG_CORE_HANDLE USB_OTG_dev;