mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-28 05:36:37 +00:00
Fix dim to use guiBacklightPin
This commit is contained in:
parent
abaa37ee5c
commit
1a0930a5ce
@ -260,6 +260,7 @@ void guiSetup(TFT_eSPI & screen, JsonObject settings)
|
|||||||
static lv_disp_buf_t disp_buf;
|
static lv_disp_buf_t disp_buf;
|
||||||
lv_disp_buf_init(&disp_buf, guiVdbBuffer, NULL, buffer_size);
|
lv_disp_buf_init(&disp_buf, guiVdbBuffer, NULL, buffer_size);
|
||||||
#endif
|
#endif
|
||||||
|
debugPrintln(String(F("LVGL: MEM size : ")) + String(LV_MEM_SIZE));
|
||||||
debugPrintln(String(F("LVGL: VDB size : ")) + String((size_t)sizeof(lv_color_t) * buffer_size));
|
debugPrintln(String(F("LVGL: VDB size : ")) + String((size_t)sizeof(lv_color_t) * buffer_size));
|
||||||
|
|
||||||
#if LV_USE_LOG != 0
|
#if LV_USE_LOG != 0
|
||||||
@ -374,7 +375,7 @@ void guiSetDim(uint8_t level)
|
|||||||
#if defined(ARDUINO_ARCH_ESP32)
|
#if defined(ARDUINO_ARCH_ESP32)
|
||||||
ledcWrite(0, map(guiDimLevel, 0, 100, 0, 1023)); // ledChannel and value
|
ledcWrite(0, map(guiDimLevel, 0, 100, 0, 1023)); // ledChannel and value
|
||||||
#else
|
#else
|
||||||
analogWrite(D1, map(guiDimLevel, 0, 100, 0, 1023));
|
analogWrite(guiBacklightPin, map(guiDimLevel, 0, 100, 0, 1023));
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
guiDimLevel = -1;
|
guiDimLevel = -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user