Skip to content

Commit

Permalink
rework on dependeny between FreeRTOS and task worker
Browse files Browse the repository at this point in the history
  • Loading branch information
QuangHaiNguyen committed Aug 4, 2024
1 parent 2110538 commit 6cde57d
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 27 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ project(EzEmbeddedFramework
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
include(CTest)
add_subdirectory(${TARGET_PATH})
add_subdirectory(extern)
endif()

add_subdirectory(easy_embedded)
add_subdirectory(extern)

if(BUILD_TESTING)
add_subdirectory(tests)
Expand Down
4 changes: 1 addition & 3 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@
"rhs": "Linux"
},
"cacheVariables": {
"TARGET_PATH": "targets/linux_freertos",
"FREERTOS_HEAP": "4",
"FREERTOS_PORT": "GCC_POSIX"
"TARGET_PATH": "targets/linux_freertos"
}
},
{
Expand Down
1 change: 0 additions & 1 deletion easy_embedded/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ target_include_directories(easy_embedded_lib
# Please add interface folders here
)


# Link libraries -------------------------------------------------------------
target_link_libraries(easy_embedded_lib
PUBLIC
Expand Down
8 changes: 2 additions & 6 deletions easy_embedded/service/task_worker/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ target_include_directories(ez_task_worker_lib
${CMAKE_CURRENT_LIST_DIR}
$<$<BOOL:${ENABLE_THREADX}>:${CMAKE_CURRENT_LIST_DIR}/threadx_port>
$<$<BOOL:${ENABLE_FREERTOS}>:${CMAKE_CURRENT_LIST_DIR}/freertos_port>
${CMAKE_SOURCE_DIR}/configs
${FREERTOS_KERNEL_PATH}/include
PRIVATE
#
INTERFACE
Expand All @@ -51,13 +49,11 @@ target_include_directories(ez_task_worker_lib
# Link libraries -------------------------------------------------------------
target_link_libraries(ez_task_worker_lib
PUBLIC
# Please add public libraries
$<$<BOOL:${ENABLE_FREERTOS}>:freertos_kernel>
$<$<BOOL:${ENABLE_THREADX}>:threadx>
PRIVATE
ez_utilities_lib
$<$<BOOL:${ENABLE_THREADX}>:threadx>
$<$<BOOL:${ENABLE_FREERTOS}>:FreeRTOS-Kernel FreeRTOS-Kernel-Heap4>
INTERFACE
# Please add interface libraries
)

# End of file
14 changes: 1 addition & 13 deletions extern/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,6 @@ if(ENABLE_FREERTOS)
message(STATUS "freertos completed")
endif()

#add_library(freertos_config INTERFACE)

#target_include_directories(freertos_config SYSTEM
#INTERFACE
# ${CMAKE_SOURCE_DIR}/targets/linux_freertos/
#)

#target_compile_definitions(freertos_config
#INTERFACE
#projCOVERAGE_TEST=0
#)

#add_subdirectory(freertos)
add_subdirectory(${CMAKE_SOURCE_DIR}/extern/freertos)
endif()

14 changes: 13 additions & 1 deletion targets/linux_freertos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,26 @@ target_include_directories(ez_target
# Please add interface folders here
)

# Config RTOS -----------------------------------------------------------------
set(FREERTOS_HEAP "4" CACHE INTERNAL "")
set(FREERTOS_PORT "GCC_POSIX" CACHE INTERNAL "")

add_library(freertos_config INTERFACE)
target_include_directories(freertos_config SYSTEM
INTERFACE
${CMAKE_SOURCE_DIR}/targets/linux_freertos/
)
target_compile_definitions(freertos_config
INTERFACE
projCOVERAGE_TEST=0
)

# Link libraries -------------------------------------------------------------
target_link_libraries(ez_target
PUBLIC
# Please add public libraries
PRIVATE
easy_embedded_lib
freertos_kernel
INTERFACE
# Please add interface libraries
)
Expand Down
3 changes: 1 addition & 2 deletions targets/linux_freertos/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@
#include "ez_logging.h"
#include "ez_easy_embedded.h"
#include "ez_task_worker.h"
#include <FreeRTOS.h>
#include <task.h>
#include "ez_freertos_port.h"


/******************************************************************************
* Module Preprocessor Macros
*******************************************************************************/
Expand Down

0 comments on commit 6cde57d

Please sign in to comment.