Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ project(lvgl C CXX)

# Set the correct FreeRTOS port for your system (e.g., Posix for WSL)
set(FREERTOS_PORT GCC_POSIX CACHE STRING "Port for FreeRTOS on Posix environment")
set(FREERTOS_HEAP "4" CACHE STRING "FreeRTOS heap implementation (1-5)")

set(LVGL_PRO_PROJECT_DIR
""
Expand All @@ -17,6 +18,7 @@ if(USE_FREERTOS)
add_library(freertos_config INTERFACE)
target_include_directories(freertos_config SYSTEM INTERFACE ${PROJECT_SOURCE_DIR}/config)
target_compile_definitions(freertos_config INTERFACE projCOVERAGE_TEST=0)
add_compile_definitions(LV_USE_OS=LV_OS_FREERTOS)

# Add FreeRTOS as a subdirectory
add_subdirectory(FreeRTOS)
Expand All @@ -25,16 +27,8 @@ if(USE_FREERTOS)
include_directories(${PROJECT_SOURCE_DIR}/FreeRTOS/include)
include_directories(${PROJECT_SOURCE_DIR}/FreeRTOS/portable/ThirdParty/GCC/Posix)
include_directories(${PROJECT_SOURCE_DIR}/config)

# Add FreeRTOS sources
file(GLOB FREERTOS_SOURCES
"${PROJECT_SOURCE_DIR}/FreeRTOS/*.c"
"${PROJECT_SOURCE_DIR}/FreeRTOS/portable/MemMang/heap_4.c"
"${PROJECT_SOURCE_DIR}/FreeRTOS/portable/ThirdParty/GCC/Posix/*.c"
)
else()
message(STATUS "FreeRTOS is disabled")
set(FREERTOS_SOURCES "") # No FreeRTOS sources if FreeRTOS is disabled
endif()

# Main include files of the project
Expand Down Expand Up @@ -74,7 +68,7 @@ set(MAIN_LIBS lvgl lvgl::examples lvgl::demos lvgl::thorvg ${SDL2_LIBRARIES})

# Create the main executable, depending on the FreeRTOS option
if(USE_FREERTOS)
list(APPEND MAIN_SOURCES src/freertos_main.c src/freertos/freertos_posix_port.c ${FREERTOS_SOURCES})
list(APPEND MAIN_SOURCES src/freertos_main.c src/freertos/freertos_posix_port.c)
list(APPEND MAIN_LIBS freertos_config freertos_kernel)
else()
list(APPEND MAIN_SOURCES src/main.c)
Expand Down
4 changes: 3 additions & 1 deletion lv_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@
* - LV_OS_MQX
* - LV_OS_SDL2
* - LV_OS_CUSTOM */
#define LV_USE_OS LV_OS_NONE
#ifndef LV_USE_OS
#define LV_USE_OS LV_OS_NONE
#endif

#if LV_USE_OS == LV_OS_CUSTOM
#define LV_OS_CUSTOM_INCLUDE <stdint.h>
Expand Down