forked from FreeRTOS/FreeRTOS-Kernel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
119 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
cmake_minimum_required(VERSION 3.15) | ||
|
||
set(PROJECT_NAME example) | ||
|
||
project(${PROJECT_NAME}) | ||
|
||
set(FREERTOS_KERNEL_PATH "../") | ||
|
||
# Add the freertos_config for FreeRTOS-Kernel | ||
add_library(freertos_config INTERFACE) | ||
|
||
target_include_directories(freertos_config | ||
INTERFACE | ||
./ | ||
../sample_configuration | ||
) | ||
|
||
# Select the heap port. values between 1-4 will pick a heap. | ||
# set(FREERTOS_HEAP "40" CACHE STRING "" FORCE) | ||
|
||
# Select the native compile PORT | ||
set(FREERTOS_PORT "TEMPLATE" CACHE STRING "" FORCE) | ||
|
||
# bring in the kernel | ||
#add_subdirectory(${FREERTOS_KERNEL_PATH}) | ||
|
||
# Adding the FreeRTOS-Kernel subdirectory | ||
add_subdirectory(${FREERTOS_KERNEL_PATH} ${CMAKE_CURRENT_BINARY_DIR}/FreeRTOS-Kernel) | ||
|
||
add_executable(${PROJECT_NAME} | ||
main.c | ||
) | ||
|
||
target_include_directories(${PROJECT_NAME} | ||
PRIVATE | ||
${CMAKE_CURRENT_LIST_DIR} | ||
) | ||
|
||
target_link_libraries(${PROJECT_NAME} freertos_kernel freertos_config) |
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,72 @@ | ||
/* | ||
* FreeRTOS Kernel <DEVELOPMENT BRANCH> | ||
* license and copyright intentionally withheld to promote copying into user code. | ||
*/ | ||
|
||
/* This is a simple main that will start freertos and run a periodic task */ | ||
/* if compiled with the template port, this project will do nothing. */ | ||
|
||
#include <FreeRTOS.h> | ||
#include <task.h> | ||
#include <queue.h> | ||
#include <timers.h> | ||
#include <semphr.h> | ||
|
||
#include <stdio.h> | ||
|
||
StackType_t exampleTaskStack[configMINIMAL_STACK_SIZE]; | ||
StaticTask_t exampleTaskTCB; | ||
|
||
void exampleTask(void *parameters) | ||
{ | ||
for (;;) | ||
{ | ||
// Example Task Code | ||
vTaskDelay(100); // delay 100 ticks | ||
} | ||
} | ||
|
||
int main(void) | ||
{ | ||
printf("Example FreeRTOS Project\n"); | ||
|
||
xTaskCreateStatic(exampleTask, "example", configMINIMAL_STACK_SIZE, NULL, configMAX_PRIORITIES - 1, exampleTaskStack, &exampleTaskTCB); | ||
|
||
vTaskStartScheduler(); | ||
|
||
for (;;) // should never get here. | ||
{ | ||
} | ||
return 0; | ||
} | ||
|
||
void vApplicationStackOverflowHook(TaskHandle_t xTask, | ||
char *pcTaskName) | ||
{ | ||
} | ||
|
||
void vApplicationGetTimerTaskMemory(StaticTask_t **ppxTimerTaskTCBBuffer, | ||
StackType_t **ppxTimerTaskStackBuffer, | ||
uint32_t *pulTimerTaskStackSize) | ||
{ | ||
static StaticTask_t xTimerTaskTCB; | ||
static StackType_t uxTimerTaskStack[configTIMER_TASK_STACK_DEPTH]; | ||
|
||
*ppxTimerTaskTCBBuffer = &xTimerTaskTCB; | ||
|
||
*ppxTimerTaskStackBuffer = uxTimerTaskStack; | ||
|
||
*pulTimerTaskStackSize = sizeof(uxTimerTaskStack) / sizeof(*uxTimerTaskStack); | ||
} | ||
|
||
void vApplicationGetIdleTaskMemory(StaticTask_t **ppxIdleTaskTCBBuffer, | ||
StackType_t **ppxIdleTaskStackBuffer, | ||
uint32_t *pulIdleTaskStackSize) | ||
{ | ||
static StaticTask_t xIdleTaskTCB; | ||
static StackType_t uxIdleTaskStack[configMINIMAL_STACK_SIZE]; | ||
|
||
*ppxIdleTaskTCBBuffer = &xIdleTaskTCB; | ||
*ppxIdleTaskStackBuffer = uxIdleTaskStack; | ||
*pulIdleTaskStackSize = configMINIMAL_STACK_SIZE; | ||
} |
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,8 @@ | ||
# Scan Target | ||
A simple project that compiles the template port to exercise the static analysis tools. This will not produce a working FreeRTOS project but it does serve to compile all the FreeRTOS components. | ||
|
||
# Building | ||
|
||
# Scanning | ||
|
||
|