Skip to content

Commit b571c5c

Browse files
committed
cgo: add FreeRTOS compatibility headers
This is especially useful if we ever want to support the ESP-IDF.
1 parent adb79f2 commit b571c5c

File tree

5 files changed

+9
-0
lines changed

5 files changed

+9
-0
lines changed

compileopts/config.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,9 @@ func (c *Config) RP2040BootPatch() bool {
201201
// preprocessing.
202202
func (c *Config) CFlags() []string {
203203
var cflags []string
204+
// Compatibility CFlags.
205+
cflags = append(cflags, "-I"+filepath.Join(goenv.Get("TINYGOROOT"), "src/compat/freertos/include"))
206+
// CFlags for the target.
204207
for _, flag := range c.Target.CFlags {
205208
cflags = append(cflags, strings.ReplaceAll(flag, "{root}", goenv.Get("TINYGOROOT")))
206209
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#include <stdint.h>
2+
3+
typedef uint32_t TickType_t;
4+
typedef int BaseType_t;
5+
typedef unsigned int UBaseType_t;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
typedef struct QueueDefinition * QueueHandle_t;

src/compat/freertos/include/freertos/semphr.h

Whitespace-only changes.

src/compat/freertos/include/freertos/task.h

Whitespace-only changes.

0 commit comments

Comments
 (0)