Same shutdown animation on all boards

This commit is contained in:
Bertrand Songis
2019-05-31 11:27:27 +02:00
parent 9888c29b76
commit f83de20232
4 changed files with 17 additions and 37 deletions
+17
View File
@@ -233,3 +233,20 @@ void drawReceiverName(coord_t x, coord_t y, uint8_t moduleIdx, uint8_t receiverI
lcdDrawText(x, y, "External", flags);
}
}
#if defined(PWR_BUTTON_PRESS)
void drawShutdownAnimation(uint32_t index, const char * message)
{
lcdClear();
int quarter = index / (PWR_PRESS_SHUTDOWN_DELAY / 5);
for (int i=1; i<=4; i++) {
if (4 - quarter >= i) {
lcdDrawFilledRect(LCD_W / 2 - 28 + 10 * i, LCD_H / 2 - 3, 6, 6, SOLID, 0);
}
}
if (message) {
lcdDrawText((LCD_W - getTextWidth(message)) / 2, LCD_H-2*FH, message);
}
lcdRefresh();
}
#endif