Skip to content

Commit 2e81554

Browse files
committed
Fix Stack_Unit_Size to match portmacro.h
#define portSTACK_TYPE uint8_t typedef portSTACK_TYPE StackType_t; Add a wrapper for xTaskCreate, because it has `static inline` in IDF FreeRTOS
1 parent 787f679 commit 2e81554

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

common/freertos_bindings.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,16 @@ portBASE_TYPE _gnat_xSemaphoreGiveFromISR
105105
portBASE_TYPE *pxHigherPriorityTaskWoken) {
106106
return xSemaphoreGiveFromISR(xSemaphore, pxHigherPriorityTaskWoken);
107107
}
108+
109+
110+
/* xTaskCreate has `static inline` markers in IDF, so can't be linked */
111+
IRAM_ATTR BaseType_t xTaskCreate2
112+
(TaskFunction_t pvTaskCode,
113+
const char * const pcName,
114+
const uint16_t usStackDepth,
115+
void * const pvParameters,
116+
UBaseType_t uxPriority,
117+
TaskHandle_t * const pvCreatedTask) {
118+
return xTaskCreate( pvTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pvCreatedTask );
119+
}
120+

common/s-fretas.adb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ package body System.FreeRTOS.Tasks is
2626
-- from portmacro.h,
2727
-- portSTACK_TYPE is unsigned long (stack size units)
2828

29-
Stack_Unit_Size : constant := 4;
29+
Stack_Unit_Size : constant := 1;
3030

3131
function Create_Task
3232
(Code : Task_Code;
@@ -52,7 +52,7 @@ package body System.FreeRTOS.Tasks is
5252
return Status_Code with
5353
Import,
5454
Convention => C,
55-
External_Name => "xTaskCreate";
55+
External_Name => "xTaskCreate2";
5656

5757
Task_Name : constant String := Name & ASCII.NUL;
5858
Status : Status_Code := Fail;

0 commit comments

Comments
 (0)