Browse Source

🐛 Fix TFT backlight sleep/wake (#23153)

vanilla_fb_2.0.x
Tanguy Pruvot 2 years ago
committed by Scott Lahteine
parent
commit
184fc36a08
  1. 8
      Marlin/src/lcd/tft/touch.cpp
  2. 8
      Marlin/src/lcd/touch/touch_buttons.cpp

8
Marlin/src/lcd/tft/touch.cpp

@ -287,15 +287,17 @@ bool Touch::get_point(int16_t *x, int16_t *y) {
#if HAS_TOUCH_SLEEP
void Touch::sleepTimeout() {
#if PIN_EXISTS(TFT_BACKLIGHT)
OUT_WRITE(TFT_BACKLIGHT_PIN, LOW);
#if HAS_LCD_BRIGHTNESS
ui.set_brightness(0);
#elif PIN_EXISTS(TFT_BACKLIGHT)
WRITE(TFT_BACKLIGHT_PIN, LOW);
#endif
next_sleep_ms = TSLP_SLEEPING;
}
void Touch::wakeUp() {
if (isSleeping()) {
#if HAS_LCD_BRIGHTNESS
ui._set_brightness();
ui.set_brightness(ui.brightness);
#elif PIN_EXISTS(TFT_BACKLIGHT)
WRITE(TFT_BACKLIGHT_PIN, HIGH);
#endif

8
Marlin/src/lcd/touch/touch_buttons.cpp

@ -115,15 +115,17 @@ uint8_t TouchButtons::read_buttons() {
#if HAS_TOUCH_SLEEP
void TouchButtons::sleepTimeout() {
#if PIN_EXISTS(TFT_BACKLIGHT)
OUT_WRITE(TFT_BACKLIGHT_PIN, LOW);
#if HAS_LCD_BRIGHTNESS
ui.set_brightness(0);
#elif PIN_EXISTS(TFT_BACKLIGHT)
WRITE(TFT_BACKLIGHT_PIN, LOW);
#endif
next_sleep_ms = TSLP_SLEEPING;
}
void TouchButtons::wakeUp() {
if (isSleeping()) {
#if HAS_LCD_BRIGHTNESS
ui._set_brightness();
ui.set_brightness(ui.brightness);
#elif PIN_EXISTS(TFT_BACKLIGHT)
WRITE(TFT_BACKLIGHT_PIN, HIGH);
#endif

Loading…
Cancel
Save