mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2024-11-25 04:48:31 +00:00
🐛 Fix TFT backlight sleep/wake (#23153)
This commit is contained in:
parent
2955061b05
commit
f33396c2c3
@ -287,15 +287,17 @@ bool Touch::get_point(int16_t *x, int16_t *y) {
|
|||||||
#if HAS_TOUCH_SLEEP
|
#if HAS_TOUCH_SLEEP
|
||||||
|
|
||||||
void Touch::sleepTimeout() {
|
void Touch::sleepTimeout() {
|
||||||
#if PIN_EXISTS(TFT_BACKLIGHT)
|
#if HAS_LCD_BRIGHTNESS
|
||||||
OUT_WRITE(TFT_BACKLIGHT_PIN, LOW);
|
ui.set_brightness(0);
|
||||||
|
#elif PIN_EXISTS(TFT_BACKLIGHT)
|
||||||
|
WRITE(TFT_BACKLIGHT_PIN, LOW);
|
||||||
#endif
|
#endif
|
||||||
next_sleep_ms = TSLP_SLEEPING;
|
next_sleep_ms = TSLP_SLEEPING;
|
||||||
}
|
}
|
||||||
void Touch::wakeUp() {
|
void Touch::wakeUp() {
|
||||||
if (isSleeping()) {
|
if (isSleeping()) {
|
||||||
#if HAS_LCD_BRIGHTNESS
|
#if HAS_LCD_BRIGHTNESS
|
||||||
ui._set_brightness();
|
ui.set_brightness(ui.brightness);
|
||||||
#elif PIN_EXISTS(TFT_BACKLIGHT)
|
#elif PIN_EXISTS(TFT_BACKLIGHT)
|
||||||
WRITE(TFT_BACKLIGHT_PIN, HIGH);
|
WRITE(TFT_BACKLIGHT_PIN, HIGH);
|
||||||
#endif
|
#endif
|
||||||
|
@ -115,15 +115,17 @@ uint8_t TouchButtons::read_buttons() {
|
|||||||
#if HAS_TOUCH_SLEEP
|
#if HAS_TOUCH_SLEEP
|
||||||
|
|
||||||
void TouchButtons::sleepTimeout() {
|
void TouchButtons::sleepTimeout() {
|
||||||
#if PIN_EXISTS(TFT_BACKLIGHT)
|
#if HAS_LCD_BRIGHTNESS
|
||||||
OUT_WRITE(TFT_BACKLIGHT_PIN, LOW);
|
ui.set_brightness(0);
|
||||||
|
#elif PIN_EXISTS(TFT_BACKLIGHT)
|
||||||
|
WRITE(TFT_BACKLIGHT_PIN, LOW);
|
||||||
#endif
|
#endif
|
||||||
next_sleep_ms = TSLP_SLEEPING;
|
next_sleep_ms = TSLP_SLEEPING;
|
||||||
}
|
}
|
||||||
void TouchButtons::wakeUp() {
|
void TouchButtons::wakeUp() {
|
||||||
if (isSleeping()) {
|
if (isSleeping()) {
|
||||||
#if HAS_LCD_BRIGHTNESS
|
#if HAS_LCD_BRIGHTNESS
|
||||||
ui._set_brightness();
|
ui.set_brightness(ui.brightness);
|
||||||
#elif PIN_EXISTS(TFT_BACKLIGHT)
|
#elif PIN_EXISTS(TFT_BACKLIGHT)
|
||||||
WRITE(TFT_BACKLIGHT_PIN, HIGH);
|
WRITE(TFT_BACKLIGHT_PIN, HIGH);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user