esp_lcd_backlight: do not build if not enabled

Signed-off-by: Rajssss <sssraj.sssraj@gmail.com>
This commit is contained in:
Rajssss 2021-06-26 13:30:26 +05:30
parent 5d4334a5b9
commit 35a005a47c
No known key found for this signature in database
GPG key ID: 5D2F803A3F7DD428
2 changed files with 8 additions and 2 deletions

View file

@ -2,7 +2,7 @@ if(ESP_PLATFORM)
file(GLOB SOURCES *.c) file(GLOB SOURCES *.c)
set(LVGL_INCLUDE_DIRS . lvgl_tft) set(LVGL_INCLUDE_DIRS . lvgl_tft)
list(APPEND SOURCES "lvgl_tft/disp_driver.c" "lvgl_tft/esp_lcd_backlight.c") list(APPEND SOURCES "lvgl_tft/disp_driver.c")
#@todo add SimleInclude macro here #@todo add SimleInclude macro here
@ -79,6 +79,11 @@ if(CONFIG_LV_TOUCH_CONTROLLER)
endif() endif()
endif() endif()
# Add backlight control to compilation only if it is selected in menuconfig
if(CONFIG_LV_ENABLE_BACKLIGHT_CONTROL)
list(APPEND SOURCES "lvgl_tft/esp_lcd_backlight.c")
endif()
idf_component_register(SRCS ${SOURCES} idf_component_register(SRCS ${SOURCES}
INCLUDE_DIRS ${LVGL_INCLUDE_DIRS} INCLUDE_DIRS ${LVGL_INCLUDE_DIRS}
REQUIRES lvgl) REQUIRES lvgl)

View file

@ -19,8 +19,9 @@
/********************* /*********************
* DEFINES * DEFINES
*********************/ *********************/
#if CONFIG_LV_ENABLE_BACKLIGHT_CONTROL
#define DISP_PIN_BCKL CONFIG_LV_DISP_PIN_BCKL #define DISP_PIN_BCKL CONFIG_LV_DISP_PIN_BCKL
#endif
/********************** /**********************
* GLOBAL PROTOTYPES * GLOBAL PROTOTYPES