kopia lustrzana https://github.com/OpenRTX/OpenRTX
Improved low battery screen rendering on smaller screens
rodzic
20667c87c4
commit
a3decb8d85
|
@ -38,25 +38,7 @@ void check_battery() {
|
||||||
|
|
||||||
// Draw low battery screen
|
// Draw low battery screen
|
||||||
if (charge <= 0) {
|
if (charge <= 0) {
|
||||||
gfx_clearScreen();
|
ui_drawLowBatteryScreen();
|
||||||
uint16_t bat_width = SCREEN_WIDTH / 2;
|
|
||||||
uint16_t bat_height = SCREEN_HEIGHT / 3;
|
|
||||||
point_t bat_pos = {SCREEN_WIDTH / 4, SCREEN_HEIGHT / 6};
|
|
||||||
gfx_drawBattery(bat_pos, bat_width, bat_height, 0.1f);
|
|
||||||
point_t text_pos_1 = {0, SCREEN_HEIGHT * 3 / 4};
|
|
||||||
point_t text_pos_2 = {0, SCREEN_HEIGHT * 3 / 4 + 16};
|
|
||||||
const color_t color_white = {255, 255, 255};
|
|
||||||
|
|
||||||
gfx_print(text_pos_1,
|
|
||||||
"For emergency operation",
|
|
||||||
FONT_SIZE_6PT,
|
|
||||||
TEXT_ALIGN_CENTER,
|
|
||||||
color_white);
|
|
||||||
gfx_print(text_pos_2,
|
|
||||||
"press any button.",
|
|
||||||
FONT_SIZE_6PT,
|
|
||||||
TEXT_ALIGN_CENTER,
|
|
||||||
color_white);
|
|
||||||
gfx_render();
|
gfx_render();
|
||||||
|
|
||||||
// Wait 5 seconds
|
// Wait 5 seconds
|
||||||
|
|
|
@ -354,6 +354,29 @@ void ui_drawSplashScreen()
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ui_drawLowBatteryScreen()
|
||||||
|
{
|
||||||
|
gfx_clearScreen();
|
||||||
|
uint16_t bat_width = SCREEN_WIDTH / 2;
|
||||||
|
uint16_t bat_height = SCREEN_HEIGHT / 3;
|
||||||
|
point_t bat_pos = {SCREEN_WIDTH / 4, SCREEN_HEIGHT / 8};
|
||||||
|
gfx_drawBattery(bat_pos, bat_width, bat_height, 0.1f);
|
||||||
|
point_t text_pos_1 = {0, SCREEN_HEIGHT * 2 / 3};
|
||||||
|
point_t text_pos_2 = {0, SCREEN_HEIGHT * 2 / 3 + 16};
|
||||||
|
const color_t color_white = {255, 255, 255};
|
||||||
|
|
||||||
|
gfx_print(text_pos_1,
|
||||||
|
"For emergency use",
|
||||||
|
FONT_SIZE_6PT,
|
||||||
|
TEXT_ALIGN_CENTER,
|
||||||
|
color_white);
|
||||||
|
gfx_print(text_pos_2,
|
||||||
|
"press any button.",
|
||||||
|
FONT_SIZE_6PT,
|
||||||
|
TEXT_ALIGN_CENTER,
|
||||||
|
color_white);
|
||||||
|
}
|
||||||
|
|
||||||
void ui_updateFSM(event_t event)
|
void ui_updateFSM(event_t event)
|
||||||
{
|
{
|
||||||
// Process pressed keys
|
// Process pressed keys
|
||||||
|
|
Ładowanie…
Reference in New Issue