🚸 TFT backlight PWM / brightness (#22841)
This commit is contained in:
committed by
Scott Lahteine
parent
34c9f64925
commit
064f91e9b0
@ -294,7 +294,9 @@ bool Touch::get_point(int16_t *x, int16_t *y) {
|
||||
}
|
||||
void Touch::wakeUp() {
|
||||
if (isSleeping()) {
|
||||
#if PIN_EXISTS(TFT_BACKLIGHT)
|
||||
#if HAS_LCD_BRIGHTNESS
|
||||
ui._set_brightness();
|
||||
#elif PIN_EXISTS(TFT_BACKLIGHT)
|
||||
WRITE(TFT_BACKLIGHT_PIN, HIGH);
|
||||
#endif
|
||||
}
|
||||
|
@ -210,6 +210,15 @@ void MarlinUI::clear_lcd() {
|
||||
cursor.set(0, 0);
|
||||
}
|
||||
|
||||
#if HAS_LCD_BRIGHTNESS
|
||||
void MarlinUI::_set_brightness() {
|
||||
#if PIN_EXISTS(TFT_BACKLIGHT)
|
||||
if (PWM_PIN(TFT_BACKLIGHT_PIN))
|
||||
analogWrite(pin_t(TFT_BACKLIGHT_PIN), brightness);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ENABLED(TOUCH_SCREEN_CALIBRATION)
|
||||
|
||||
void MarlinUI::touch_calibration_screen() {
|
||||
|
Reference in New Issue
Block a user