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
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

-17
View File
@@ -1011,20 +1011,3 @@ void lcdDrawHorizontalLine(coord_t x, coord_t y, coord_t w, uint8_t pat, LcdFlag
p++;
}
}
#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
-20
View File
@@ -33,26 +33,6 @@ void drawSleepBitmap()
lcdRefresh();
}
#if defined(PWR_BUTTON_PRESS)
const unsigned char SHUTDOWN_BITMAP[] = {
#include "../../bitmaps/212x64/shutdown.lbm"
};
#define SHUTDOWN_BITMAP_WIDTH 60
#define SHUTDOWN_BITMAP_HEIGHT 60
void drawShutdownAnimation(uint32_t index, const char * message)
{
index /= (PWR_PRESS_SHUTDOWN_DELAY / 4);
lcdRefreshWait();
lcdClear();
lcdDrawBitmap((LCD_W-SHUTDOWN_BITMAP_WIDTH)/2, (LCD_H-SHUTDOWN_BITMAP_HEIGHT)/2, SHUTDOWN_BITMAP, (3 - index) * SHUTDOWN_BITMAP_WIDTH, SHUTDOWN_BITMAP_WIDTH);
if (message) {
lcdDrawText((LCD_W - getTextWidth(message)) / 2, LCD_H-2*FH, message);
}
lcdRefresh();
}
#endif
void drawStick(coord_t centrex, int16_t xval, int16_t yval)
{
#define BOX_CENTERY (LCD_H-BOX_WIDTH/2-10)
+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