🚸 TFT backlight PWM / brightness (#22841)

This commit is contained in:
Tanguy Pruvot
2021-09-27 21:01:47 +02:00
committed by GitHub
parent 942b76082c
commit f73175d826
7 changed files with 40 additions and 3 deletions

View File

@@ -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() {