minor fixes

This commit is contained in:
Vitor Alho 2023-09-05 11:57:13 -03:00
parent 0b55ade07e
commit 6a6fdcf289

View file

@ -84,22 +84,20 @@ if(CONFIG_LV_I2C)
list(APPEND SOURCES "lvgl_i2c/i2c_manager.c")
endif()
if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_GREATER_EQUAL "5.0")
idf_component_register( SRCS ${SOURCES}
INCLUDE_DIRS ${LVGL_INCLUDE_DIRS}
REQUIRES lvgl driver)
set(USE_PORT_TICK_PERIOD_MS)
else()
idf_component_register( SRCS ${SOURCES}
INCLUDE_DIRS ${LVGL_INCLUDE_DIRS}
if(ESP_IDF_VERSION_MAJOR>=5)
REQUIRES lvgl driver
else
REQUIRES lvgl
endif)
INCLUDE_DIRS ${LVGL_INCLUDE_DIRS}
REQUIRES lvgl)
set(USE_PORT_TICK_RATE_MS)
endif()
target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_LVGL_H_INCLUDE_SIMPLE")
if(ESP_IDF_VERSION_MAJOR >= 5)
target_compile_definitions(${COMPONENT_LIB} PUBLIC "-USE_PORT_TICK_PERIOD_MS")
else()
target_compile_definitions(${COMPONENT_LIB} PUBLIC "-USE_PORT_TICK_RATE_MS")
endif()
else()
message(FATAL_ERROR "LVGL ESP32 drivers: ESP_PLATFORM is not defined. Try reinstalling ESP-IDF.")
endif()