-
Notifications
You must be signed in to change notification settings - Fork 391
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add support for FreeRTOS Compiles for FreeRTOS when __FREERTOS__ is defined. Note that _WIN32 and __FREERTOS__ can coexist! * Add FreeRTOS sample --------- Co-authored-by: Sergey Podobry <[email protected]>
- Loading branch information
1 parent
96637a6
commit 94899e0
Showing
6 changed files
with
766 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux") | ||
include(FetchContent) | ||
|
||
# Select FreeRTOS port | ||
set(FREERTOS_PORT "GCC_POSIX") | ||
|
||
# Select FreeRTOS heap | ||
set(FREERTOS_HEAP "4") | ||
|
||
# Add the freertos_config for FreeRTOS-Kernel | ||
add_subdirectory(freertos_config) | ||
|
||
# Download FreeRTOS-Kernel sources | ||
FetchContent_Declare( | ||
freertos_kernel | ||
URL https://github.com/FreeRTOS/FreeRTOS-Kernel/archive/refs/tags/V11.1.0.tar.gz | ||
URL_HASH SHA256=0e21928b3bcc4f9bcaf7333fb1c8c0299d97e2ec9e13e3faa2c5a7ac8a3bc573 | ||
DOWNLOAD_EXTRACT_TIMESTAMP TRUE | ||
) | ||
|
||
FetchContent_MakeAvailable(freertos_kernel) | ||
|
||
# Describe our executable | ||
add_executable(FreeRTOS main.cpp) | ||
target_link_libraries(FreeRTOS freertos_kernel freertos_config plog::plog) | ||
|
||
# Important!!! There is no standard way to know if the code is compiled for FreeRTOS. So we define __FREERTOS__ macro. | ||
target_compile_definitions(FreeRTOS PUBLIC __FREERTOS__) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
add_library(freertos_config INTERFACE) | ||
target_include_directories(freertos_config INTERFACE .) |
Oops, something went wrong.