techo: display backlight behavior

This commit is contained in:
Florent de Lamotte 2025-09-02 11:43:48 +02:00
parent 1a41da6bf2
commit 3cdf2f9b4d
3 changed files with 12 additions and 2 deletions

View file

@ -519,6 +519,14 @@ void UITask::loop() {
c = handleLongPress(KEY_ENTER);
}
#endif
#if defined(DISP_BACKLIGHT) && defined(BACKLIGHT_BTN)
static int next_btn_check = 0;
if (millis() > next_btn_check) {
bool touch_state = digitalRead(PIN_BUTTON2);
digitalWrite(DISP_BACKLIGHT, !touch_state);
next_btn_check = millis() + 300;
}
#endif
if (c != 0 && curr) {
curr->handleInput(c);