Skip to content

Commit

Permalink
add method to provide custom port
Browse files Browse the repository at this point in the history
  • Loading branch information
maciekr1234 committed May 5, 2023
1 parent a41f9d5 commit aa0229c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
13 changes: 13 additions & 0 deletions include/freertos/portmacro.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
#pragma once

#include "stm32_def.h"
#include "FreeRTOSConfig.h"


#ifdef __cplusplus
extern "C" {
#endif

#if defined(configUSE_CUSTOM_PORT) && defined(configCUSTOM_PORT_PORTMACRO)
#if __has_include(configCUSTOM_PORT_PORTMACRO)
#include configCUSTOM_PORT_PORTMACRO
#else
#error "configCUSTOM_PORT_PORTMACRO not found!"
#endif
#else



#ifndef __CORTEX_M
#pragma GCC error "no \"__CORTEX_M\" definition"
Expand Down Expand Up @@ -42,6 +53,8 @@ extern "C" {
#endif
#endif

#endif

#ifdef __cplusplus
} // extern "C"
#endif
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "freertos_kernel",
"version": "10.4.3-3",
"version": "10.4.3-4",
"keywords": "rtos, timing, thread, task, mutex, semaphore",
"description": "FreeRTOS kernel as pio library.",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion portable/MemMang/heap_useNewlib_ST.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ void __malloc_unlock(struct _reent* r) {
void __env_lock() { vTaskSuspendAll(); };
void __env_unlock() { (void)xTaskResumeAll(); };

#if 1 // Provide malloc debug and accounting wrappers
#if 0//1 // Provide malloc debug and accounting wrappers
/// /brief Wrap malloc/malloc_r to help debug who requests memory and why.
/// To use these, add linker options: -Xlinker --wrap=malloc -Xlinker --wrap=_malloc_r
// Note: These functions are normally unused and stripped by linker.
Expand Down
12 changes: 11 additions & 1 deletion src/port.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@

#include "stm32_def.h"
#include "FreeRTOSConfig.h"


#ifdef __cplusplus
extern "C" {
#endif


#if defined(configUSE_CUSTOM_PORT) && defined(configCUSTOM_PORT_SOURCE)
#if __has_include(configCUSTOM_PORT_SOURCE)
#include configCUSTOM_PORT_SOURCE
#else
#error "configCUSTOM_PORT_SOURCE not found!"
#endif
#else

#ifndef __CORTEX_M
#pragma GCC error "no \"__CORTEX_M\" definition"
#endif
Expand Down Expand Up @@ -40,7 +50,7 @@ extern "C" {
#include "../freertos/portable/GCC/ARM_CM7/r0p1/port.c"
#endif
#endif

#endif
#ifdef __cplusplus
} // extern "C"
#endif

0 comments on commit aa0229c

Please sign in to comment.