-
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
1 parent
cfd522c
commit 74c8961
Showing
35 changed files
with
270 additions
and
2 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,3 @@ | ||
* text=auto eol=lf | ||
*.{cmd,[cC][mM][dD]} text eol=crlf | ||
*.{bat,[bB][aA][tT]} text eol=crlf |
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,12 @@ | ||
Desktop.ini | ||
Thumbs.db | ||
ehthumbs.db | ||
.pio/* | ||
|
||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/bookmarks.json | ||
|
||
.bin/ |
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,3 @@ | ||
[submodule "freertos"] | ||
path = freertos | ||
url = https://github.com/FreeRTOS/FreeRTOS-Kernel.git |
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 @@ | ||
#pragma once | ||
#include "../freertos/include/FreeRTOS.h" |
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 @@ | ||
#pragma once | ||
#include "../freertos/include/StackMacros.h" |
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 @@ | ||
#pragma once | ||
#include "../freertos/include/atomic.h" |
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 @@ | ||
#pragma once | ||
#include "../freertos/include/croutine.h" |
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 @@ | ||
#pragma once | ||
#include "../freertos/include/deprecated_definitions.h" |
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 @@ | ||
#pragma once | ||
#include "../freertos/include/event_groups.h" |
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 @@ | ||
#pragma once | ||
#include "../freertos/include/list.h" |
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 @@ | ||
#pragma once | ||
#include "../freertos/include/message_buffer.h" |
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 @@ | ||
#pragma once | ||
#include "../freertos/include/mpu_prototypes.h" |
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 @@ | ||
#pragma once | ||
#include "../freertos/include/mpu_wrappers.h" |
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 @@ | ||
#pragma once | ||
#include "../freertos/include/portable.h" |
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,47 @@ | ||
#pragma once | ||
|
||
#include "stm32_def.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
|
||
#ifndef __CORTEX_M | ||
#pragma GCC error "no \"__CORTEX_M\" definition" | ||
#endif | ||
|
||
#if (__CORTEX_M == 0x00U) | ||
#include "../freertos/portable/GCC/ARM_CM0/portmacro.h" | ||
#endif | ||
|
||
#if (__CORTEX_M == 0x03U) | ||
/* MPU not supported */ | ||
#if 0 /*(__MPU_PRESENT == 1)*/ | ||
#include "../freertos/portable/GCC/ARM_CM3_MPU/portmacro.h" | ||
#else | ||
#include "../freertos/portable/GCC/ARM_CM3/portmacro.h" | ||
#endif | ||
#endif | ||
|
||
#if (__CORTEX_M == 0x04U) | ||
/* MPU not supported */ | ||
#if 0 /*(__MPU_PRESENT == 1)*/ | ||
#include "../freertos/portable/GCC/ARM_CM4_MPU/portmacro.h" | ||
#else | ||
#include "../freertos/portable/GCC/ARM_CM4F/portmacro.h" | ||
#endif | ||
#endif | ||
|
||
#if (__CORTEX_M == 0x07U) | ||
/* MPU not supported */ | ||
#if 0 /*(__MPU_PRESENT == 1)*/ | ||
#include "../freertos/portable/GCC/ARM_CM7_MPU/r0p1/portmacro.h" | ||
#else | ||
#include "../freertos/portable/GCC/ARM_CM7/r0p1/portmacro.h" | ||
#endif | ||
#endif | ||
|
||
#ifdef __cplusplus | ||
} // extern "C" | ||
#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 @@ | ||
#pragma once | ||
#include "../freertos/include/projdefs.h" |
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 @@ | ||
#pragma once | ||
#include "../freertos/include/queue.h" |
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 @@ | ||
#pragma once | ||
#include "../freertos/include/semphr.h" |
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 @@ | ||
#pragma once | ||
#include "../freertos/include/stack_macros.h" |
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 @@ | ||
#pragma once | ||
#include "../freertos/include/stream_buffer.h" |
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 @@ | ||
#pragma once | ||
#include "../freertos/include/task.h" |
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 @@ | ||
#pragma once | ||
#include "../freertos/include/timers.h" |
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 |
---|---|---|
@@ -1,15 +1,22 @@ | ||
{ | ||
"name": "freertos_kernel", | ||
"version": "10.2.1", | ||
"version": "10.4.2", | ||
"keywords": "rtos, timing, thread, task, mutex, semaphore", | ||
"description": "FreeRTOS kernel as pio library.", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/maciekr1234/freertos_kernel_lib.git" | ||
}, | ||
"frameworks": "arduino", | ||
"frameworks": "*", | ||
"platforms": "ststm32", | ||
"build": { | ||
"extraScript": "pio_build.py", | ||
"libArchive": false | ||
}, | ||
"export": { | ||
"exclude": [ | ||
".bin", | ||
"tools" | ||
] | ||
} | ||
} |
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 @@ | ||
import os | ||
from os.path import sep, join, realpath, isdir, isfile | ||
|
||
Import("env") | ||
|
||
env.Append(CPPPATH=[ | ||
realpath(join("include", "freertos")) | ||
]) |
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 @@ | ||
#include "../freertos/croutine.c" |
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 @@ | ||
#include "../freertos/event_groups.c" |
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,23 @@ | ||
|
||
#include "FreeRTOS.h" | ||
|
||
|
||
#ifndef configMEMMANG_HEAP_NB | ||
#define configMEMMANG_HEAP_NB 5 | ||
#endif | ||
|
||
#if (configMEMMANG_HEAP_NB == -1) | ||
// #include "../freertos/portable/MemMang/heap_useNewlib.c" | ||
#elif (configMEMMANG_HEAP_NB == 1) | ||
#include "../freertos/portable/MemMang/heap_1.c" | ||
#elif (configMEMMANG_HEAP_NB == 2) | ||
#include "../freertos/portable/MemMang/heap_2.c" | ||
#elif (configMEMMANG_HEAP_NB == 3) | ||
#include "../freertos/portable/MemMang/heap_3.c" | ||
#elif (configMEMMANG_HEAP_NB == 4) | ||
#include "../freertos/portable/MemMang/heap_4.c" | ||
#elif (configMEMMANG_HEAP_NB == 5) | ||
#include "../freertos/portable/MemMang/heap_5.c" | ||
#else | ||
#error "Wrong Memory allocation implementations defined" | ||
#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 @@ | ||
#include "../freertos/list.c" |
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,46 @@ | ||
|
||
#include "stm32_def.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
|
||
#ifndef __CORTEX_M | ||
#pragma GCC error "no \"__CORTEX_M\" definition" | ||
#endif | ||
|
||
#if (__CORTEX_M == 0x00U) | ||
#include "../freertos/portable/GCC/ARM_CM0/port.c" | ||
#endif | ||
|
||
#if (__CORTEX_M == 0x03U) | ||
/* MPU not supported */ | ||
#if 0 /*(__MPU_PRESENT == 1)*/ | ||
#include "../freertos/portable/GCC/ARM_CM3_MPU/port.c" | ||
#else | ||
#include "../freertos/portable/GCC/ARM_CM3/port.c" | ||
#endif | ||
#endif | ||
|
||
#if (__CORTEX_M == 0x04U) | ||
/* MPU not supported */ | ||
#if 0 /*(__MPU_PRESENT == 1)*/ | ||
#include "../freertos/portable/GCC/ARM_CM4_MPU/port.c" | ||
#else | ||
#include "../freertos/portable/GCC/ARM_CM4F/port.c" | ||
#endif | ||
#endif | ||
|
||
#if (__CORTEX_M == 0x07U) | ||
/* MPU not supported */ | ||
#if 0 /*(__MPU_PRESENT == 1)*/ | ||
#include "../freertos/portable/GCC/ARM_CM7_MPU/r0p1/port.c" | ||
#else | ||
#include "../freertos/portable/GCC/ARM_CM7/r0p1/port.c" | ||
#endif | ||
#endif | ||
|
||
#ifdef __cplusplus | ||
} // extern "C" | ||
#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 @@ | ||
#include "../freertos/queue.c" |
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 @@ | ||
#include "../freertos/stream_buffer.c" |
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 @@ | ||
#include "../freertos/tasks.c" |
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 @@ | ||
#include "../freertos/timers.c" |
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,75 @@ | ||
|
||
import os,sys | ||
|
||
from os.path import sep, join, realpath, isdir, isfile, dirname | ||
from string import Template | ||
|
||
|
||
root_dir = realpath(join(dirname(realpath(__file__)), "..")) | ||
include_dir = join(root_dir, "include") | ||
|
||
freertos_root_dir = join(root_dir, "freertos") | ||
freertos_portable_dir = join(freertos_root_dir, "portable") | ||
|
||
|
||
freertos_header_tpl = Template('#pragma once\n#include "../freertos/include/$name"\n') | ||
freertos_src_tpl = Template('#include "../freertos/$name"\n') | ||
|
||
|
||
freertos_include_names = [ | ||
"FreeRTOS.h", | ||
"StackMacros.h", | ||
"atomic.h", | ||
"croutine.h", | ||
"deprecated_definitions.h", | ||
"event_groups.h", | ||
"list.h", | ||
"message_buffer.h", | ||
"mpu_prototypes.h", | ||
"mpu_wrappers.h", | ||
"portable.h", | ||
"projdefs.h", | ||
"queue.h", | ||
"semphr.h", | ||
"stack_macros.h", | ||
"stream_buffer.h", | ||
"task.h", | ||
"timers.h", | ||
] | ||
|
||
freertos_src_names = [ | ||
"croutine.c", | ||
"event_groups.c", | ||
"list.c", | ||
"queue.c", | ||
"stream_buffer.c", | ||
"tasks.c", | ||
"timers.c", | ||
] | ||
|
||
def generate_freertos_header(name): | ||
file_path = join(include_dir, name) | ||
if os.path.exists(file_path): | ||
os.remove(file_path) | ||
|
||
with open(file_path,"w") as header_file: | ||
header_file.write(freertos_header_tpl.substitute(name=name)) | ||
|
||
def generate_freertos_src(name): | ||
file_path = join(root_dir, "src", name) | ||
if os.path.exists(file_path): | ||
os.remove(file_path) | ||
|
||
with open(file_path,"w") as f: | ||
f.write(freertos_src_tpl.substitute(name=name)) | ||
|
||
|
||
def main(): | ||
for header in freertos_include_names: | ||
generate_freertos_header(header) | ||
|
||
for f in freertos_src_names: | ||
generate_freertos_src(f) | ||
|
||
if __name__ == "__main__": | ||
sys.exit(main()) |