Same shutdown animation on all boards
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user