Skip to content

Commit 35a005a

Browse files
committed
esp_lcd_backlight: do not build if not enabled
Signed-off-by: Rajssss <[email protected]>
1 parent 5d4334a commit 35a005a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ if(ESP_PLATFORM)
22

33
file(GLOB SOURCES *.c)
44
set(LVGL_INCLUDE_DIRS . lvgl_tft)
5-
list(APPEND SOURCES "lvgl_tft/disp_driver.c" "lvgl_tft/esp_lcd_backlight.c")
5+
list(APPEND SOURCES "lvgl_tft/disp_driver.c")
66

77
#@todo add SimleInclude macro here
88

@@ -79,6 +79,11 @@ if(CONFIG_LV_TOUCH_CONTROLLER)
7979
endif()
8080
endif()
8181

82+
# Add backlight control to compilation only if it is selected in menuconfig
83+
if(CONFIG_LV_ENABLE_BACKLIGHT_CONTROL)
84+
list(APPEND SOURCES "lvgl_tft/esp_lcd_backlight.c")
85+
endif()
86+
8287
idf_component_register(SRCS ${SOURCES}
8388
INCLUDE_DIRS ${LVGL_INCLUDE_DIRS}
8489
REQUIRES lvgl)

lvgl_tft/esp_lcd_backlight.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@
1919
/*********************
2020
* DEFINES
2121
*********************/
22+
#if CONFIG_LV_ENABLE_BACKLIGHT_CONTROL
2223
#define DISP_PIN_BCKL CONFIG_LV_DISP_PIN_BCKL
23-
24+
#endif
2425

2526
/**********************
2627
* GLOBAL PROTOTYPES

0 commit comments

Comments
 (0)