✨ TFT Screen/Backlight Sleep (#22617)
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user