🚸 TFT backlight PWM / brightness (#22841)

This commit is contained in:
Tanguy Pruvot
2021-09-27 21:01:47 +02:00
committed by Scott Lahteine
parent 34c9f64925
commit 064f91e9b0
7 changed files with 40 additions and 3 deletions

View File

@ -49,6 +49,10 @@
#include "ili9341.h"
#include "ili9328.h"
#if HAS_LCD_BRIGHTNESS
#include "../marlinui.h"
#endif
#define DEBUG_OUT ENABLED(DEBUG_GRAPHICAL_TFT)
#include "../../core/debug_out.h"
@ -72,6 +76,9 @@ if (lcd_id != 0xFFFFFFFF) return;
#if PIN_EXISTS(TFT_BACKLIGHT)
WRITE(TFT_BACKLIGHT_PIN, DISABLED(DELAYED_BACKLIGHT_INIT));
#if HAS_LCD_BRIGHTNESS && DISABLED(DELAYED_BACKLIGHT_INIT)
ui._set_brightness();
#endif
#endif
// io.Init();
@ -141,11 +148,12 @@ if (lcd_id != 0xFFFFFFFF) return;
lcd_id = 0;
}
#else
#error Unsupported TFT driver
#error "Unsupported TFT driver"
#endif
#if PIN_EXISTS(TFT_BACKLIGHT) && ENABLED(DELAYED_BACKLIGHT_INIT)
WRITE(TFT_BACKLIGHT_PIN, HIGH);
TERN_(HAS_LCD_BRIGHTNESS, ui._set_brightness());
#endif
}