-
Notifications
You must be signed in to change notification settings - Fork 917
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cgo: add FreeRTOS compatibility headers
This is especially useful if we ever want to support the ESP-IDF. Currently implemented: - xSemaphoreCreateRecursiveMutex - xSemaphoreDelete - xSemaphoreTakeRecursive - xSemaphoreGiveRecursive
- Loading branch information
Showing
6 changed files
with
28 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
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,9 @@ | ||
#pragma once | ||
|
||
#include <stdint.h> | ||
|
||
typedef uint32_t TickType_t; | ||
typedef int BaseType_t; | ||
typedef unsigned int UBaseType_t; | ||
|
||
#define portMAX_DELAY (TickType_t)0xffffffffUL |
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 @@ | ||
#pragma once | ||
|
||
typedef struct QueueDefinition * QueueHandle_t; |
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 @@ | ||
#pragma once | ||
|
||
// Note: in FreeRTOS, SemaphoreHandle_t is an alias for QueueHandle_t. | ||
typedef struct SemaphoreDefinition * SemaphoreHandle_t; | ||
|
||
SemaphoreHandle_t xSemaphoreCreateRecursiveMutex(void); | ||
|
||
void vSemaphoreDelete(SemaphoreHandle_t xSemaphore); | ||
|
||
// Note: these two functions are macros in FreeRTOS. | ||
BaseType_t xSemaphoreTakeRecursive(SemaphoreHandle_t xMutex, TickType_t xTicksToWait); | ||
BaseType_t xSemaphoreGiveRecursive(SemaphoreHandle_t xMutex); |
Empty file.