TFT Screen/Backlight Sleep (#22617)

This commit is contained in:
Tanguy Pruvot
2021-09-14 04:07:08 +02:00
committed by GitHub
parent ae22a92017
commit c2e4b1626f
17 changed files with 176 additions and 25 deletions

View File

@@ -37,6 +37,27 @@ static xy_uint_t cursor;
bool draw_menu_navigation = false;
#endif
#if HAS_TOUCH_SLEEP
bool lcd_sleep_task() {
static bool sleepCleared;
if (touch.isSleeping()) {
tft.queue.reset();
if (!sleepCleared) {
sleepCleared = true;
ui.clear_lcd();
tft.queue.async();
}
touch.idle();
return true;
}
else
sleepCleared = false;
return false;
}
#endif
void menu_line(const uint8_t row, uint16_t color) {
cursor.set(0, row);
tft.canvas(0, TFT_TOP_LINE_Y + cursor.y * MENU_LINE_HEIGHT, TFT_WIDTH, MENU_ITEM_HEIGHT);