[Horus] Refactoring for the new fatal errors

This commit is contained in:
Bertrand Songis
2016-08-31 01:04:11 +02:00
parent 855814655e
commit 82b9ecc155
25 changed files with 165 additions and 75 deletions
+26
View File
@@ -63,4 +63,30 @@ swsrc_t editSwitch(coord_t x, coord_t y, swsrc_t value, LcdFlags attr, event_t e
return value;
}
void drawFatalErrorScreen(const char * message)
{
lcdClear();
lcdDrawText(LCD_W/2, LCD_H/2-20, message, DBLSIZE|CENTERED|TEXT_BGCOLOR);
lcdRefresh();
}
void runFatalErrorScreen(const char * message)
{
while (1) {
drawFatalErrorScreen(message);
uint8_t refresh = false;
while (1) {
uint32_t pwr_check = pwrCheck();
if (pwr_check == e_power_off) {
boardOff();
}
else if (pwr_check == e_power_press) {
refresh = true;
}
else if (pwr_check == e_power_on && refresh) {
break;
}
SIMU_SLEEP_NORET(1);
}
}
}