diff --git a/src/dev/esp32/esp32.cpp b/src/dev/esp32/esp32.cpp index cc378ef9..626387f1 100644 --- a/src/dev/esp32/esp32.cpp +++ b/src/dev/esp32/esp32.cpp @@ -186,9 +186,9 @@ void Esp32Device::set_backlight_pin(uint8_t pin) if(pin < GPIO_NUM_MAX) { LOG_VERBOSE(TAG_GUI, F("Backlight : Pin %d"), pin); #ifndef ESP32S2 - ledcSetup(BACKLIGHT_CHANNEL, 20000, 12); + ledcSetup(BACKLIGHT_CHANNEL, BACKLIGHT_FREQUENCY, 12); #else - ledcSetup(BACKLIGHT_CHANNEL, 20000, 10); + ledcSetup(BACKLIGHT_CHANNEL, BACKLIGHT_FREQUENCY, 10); #endif ledcAttachPin(pin, BACKLIGHT_CHANNEL); update_backlight(); diff --git a/src/dev/esp32/esp32.h b/src/dev/esp32/esp32.h index 2b228da5..71fc307c 100644 --- a/src/dev/esp32/esp32.h +++ b/src/dev/esp32/esp32.h @@ -9,6 +9,10 @@ #if defined(ESP32) +#ifndef BACKLIGHT_FREQUENCY +#define BACKLIGHT_FREQUENCY 20000 +#endif + #ifdef __cplusplus extern "C" { #endif diff --git a/user_setups/esp32s2/wt-86-32-3zw1.ini b/user_setups/esp32s2/wt-86-32-3zw1.ini index 73f887fb..3a4e8821 100644 --- a/user_setups/esp32s2/wt-86-32-3zw1.ini +++ b/user_setups/esp32s2/wt-86-32-3zw1.ini @@ -2,7 +2,7 @@ ; Wireless-Tag WT-86-32-3ZW1 ; ; - custom ESP32-S2 pcb ; ; - ili9488 TFT 8-bit ; -; - gls1680 touch controller ; +; - gsl1680 touch controller ; ;***************************************************; [env:wt-86-32-3zw1] @@ -45,20 +45,22 @@ build_flags = -D LGFX_USE_V1=1 -D SUPPORT_TRANSACTIONS -D SPI_TOUCH_FREQUENCY=2500000 - -D TOUCH_DRIVER=0x1680 ; GLS1680 Capacitive I2C touch panel driver + -D TOUCH_DRIVER=0x1680 ; GSL1680 Capacitive I2C touch panel driver -D I2C_TOUCH_PORT=0 -D I2C_TOUCH_ADDRESS=0x40 -D I2C_TOUCH_FREQUENCY=400000 + + -D BACKLIGHT_FREQUENCY=2000 ;endregion ;region -- Library options ------------------------------- lib_deps = ${env.lib_deps} ${esp32s2.lib_deps} + ${gsl1680.lib_deps} ;lovyan03/LovyanGFX @ ^0.4.14 https://github.com/lovyan03/LovyanGFX.git#1be6600 - git+https://github.com/arovak/GSL2038.git lib_ignore = ${env.lib_ignore}