🐛 Fix TFT backlight [STM32] (#23062)

This commit is contained in:
Tanguy Pruvot
2021-11-04 18:04:04 +01:00
committed by Scott Lahteine
parent 89ec1c71f0
commit fd136d5501
6 changed files with 22 additions and 8 deletions

View File

@ -210,12 +210,14 @@ void MarlinUI::clear_lcd() {
}
#if HAS_LCD_BRIGHTNESS
void MarlinUI::_set_brightness() {
#if PIN_EXISTS(TFT_BACKLIGHT)
if (PWM_PIN(TFT_BACKLIGHT_PIN))
set_pwm_duty(pin_t(TFT_BACKLIGHT_PIN), brightness);
analogWrite(pin_t(TFT_BACKLIGHT_PIN), backlight ? brightness : 0);
#endif
}
#endif
#if ENABLED(TOUCH_SCREEN_CALIBRATION)