diff --git a/CMakeLists.txt b/CMakeLists.txt index b013003..14c29c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,7 +88,7 @@ endif() idf_component_register(SRCS ${SOURCES} INCLUDE_DIRS ${LVGL_INCLUDE_DIRS} - REQUIRES lvgl) + REQUIRES lvgl driver esp_common log freertos esp_rom soc) target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_LVGL_H_INCLUDE_SIMPLE") diff --git a/lvgl_tft/esp_lcd_backlight.c b/lvgl_tft/esp_lcd_backlight.c index f4395bd..2d74f36 100644 --- a/lvgl_tft/esp_lcd_backlight.c +++ b/lvgl_tft/esp_lcd_backlight.c @@ -8,10 +8,12 @@ *********************/ #include "esp_lcd_backlight.h" #include "driver/ledc.h" -#include "driver/gpio.h" +#include "rom/gpio.h" #include "esp_log.h" #include "soc/ledc_periph.h" // to invert LEDC output on IDF version < v4.3 +#define SIG_GPIO_OUT_IDX 128 + typedef struct { bool pwm_control; // true: LEDC is used, false: GPIO is used int index; // Either GPIO or LEDC channel @@ -49,7 +51,7 @@ disp_backlight_h disp_backlight_new(const disp_backlight_config_t *config) }; const ledc_timer_config_t LCD_backlight_timer = { .speed_mode = LEDC_LOW_SPEED_MODE, - .bit_num = LEDC_TIMER_10_BIT, + .duty_resolution = LEDC_TIMER_10_BIT, .timer_num = config->timer_idx, .freq_hz = 5000, .clk_cfg = LEDC_AUTO_CLK};