RTOS Wrapper
API reference
Loading...
Searching...
No Matches
os_freertos.h
Go to the documentation of this file.
1#pragma once
23/* ── Kernel header layout ─────────────────────────────────────────────────
24 * ESP-IDF installs the kernel under a `freertos/` prefix; every other port
25 * (CubeMX, vanilla upstream, Zephyr's FreeRTOS shim) ships the headers flat.
26 * Probe instead of assuming, so neither layout needs a build-system shim. */
27#if defined(__has_include)
28# if __has_include("freertos/FreeRTOS.h")
29# define HF_OS_FREERTOS_PREFIXED 1
30# else
31# define HF_OS_FREERTOS_PREFIXED 0
32# endif
33#elif defined(ESP_PLATFORM)
34# define HF_OS_FREERTOS_PREFIXED 1
35#else
36# define HF_OS_FREERTOS_PREFIXED 0
37#endif
38
39#if HF_OS_FREERTOS_PREFIXED
40# include "freertos/FreeRTOS.h"
41# include "freertos/task.h"
42# include "freertos/semphr.h"
43# include "freertos/queue.h"
44# include "freertos/event_groups.h"
45# include "freertos/timers.h"
46# include "freertos/stream_buffer.h"
47#else
48# include "FreeRTOS.h"
49# include "task.h"
50# include "semphr.h"
51# include "queue.h"
52# include "event_groups.h"
53# include "timers.h"
54# include "stream_buffer.h"
55#endif
56
57#include <stddef.h>
58#include <stdint.h>
59
60/* ── SMP capability ───────────────────────────────────────────────────────
61 * Core-affinity task creation and spinlock critical sections exist only on
62 * genuinely multi-core kernels. Detect after the kernel headers so the port
63 * config macros are visible. */
64#if defined(ESP_PLATFORM) || \
65 (defined(portNUM_PROCESSORS) && (portNUM_PROCESSORS > 1)) || \
66 (defined(configNUM_CORES) && (configNUM_CORES > 1))
67# define HF_OS_FREERTOS_SMP 1
68#else
69# define HF_OS_FREERTOS_SMP 0
70#endif
71
72#ifdef __cplusplus
73extern "C" {
74#endif
75
77typedef TaskHandle_t OS_Thread;
78typedef SemaphoreHandle_t OS_Mutex;
79typedef SemaphoreHandle_t OS_Semaphore;
80typedef QueueHandle_t OS_Queue;
81typedef EventGroupHandle_t OS_EventGroup;
82typedef TimerHandle_t OS_Timer;
83typedef StreamBufferHandle_t OS_StreamBuffer;
84
86typedef unsigned long OS_Ulong;
87typedef unsigned int OS_Uint;
88
89enum {
90 OS_WAIT_FOREVER = portMAX_DELAY,
93 OS_AND = 1,
94 OS_OR = 2,
98 OS_INHERIT = 0
99};
100
101static inline OS_Ulong os_time_get(void) { return xTaskGetTickCount(); }
102
103/* Thread wrappers ---------------------------------------------------------*/
104typedef struct {
105 void (*entry)(OS_Ulong);
108
109static inline void os_thread_start_trampoline(void *p)
110{
112 vPortFree(p);
113 params.entry(params.arg);
114}
115
116static inline OS_Uint os_thread_create(OS_Thread *t, const char *name,
117 void (*entry)(OS_Ulong),
118 OS_Ulong input, uint8_t *stack,
119 OS_Ulong stack_size, OS_Uint priority,
120 OS_Uint preempt, OS_Ulong slice,
121 OS_Uint auto_start)
122{
123 /* xTaskCreate allocates the stack. stack/preempt/slice stay in the
124 * ThreadX-shaped signature; this backend does not install them. */
125 (void)stack;
126 (void)preempt;
127 (void)slice;
128 os_thread_start_t *params =
129 (os_thread_start_t *)pvPortMalloc(sizeof(os_thread_start_t));
130 if (!params) return 1;
131 params->entry = entry;
132 params->arg = input;
133 BaseType_t res = xTaskCreate(os_thread_start_trampoline, name,
134 stack_size / sizeof(StackType_t), params,
135 priority, t);
136 if (res != pdPASS) {
137 vPortFree(params);
138 return 1;
139 }
140 if (!auto_start)
141 vTaskSuspend(*t);
142 return OS_SUCCESS;
143}
144
154static inline OS_Uint os_thread_create_pinned(OS_Thread *t, const char *name,
155 void (*entry)(OS_Ulong),
156 OS_Ulong input, uint8_t *stack,
157 OS_Ulong stack_size, OS_Uint priority,
158 OS_Uint preempt, OS_Ulong slice,
159 OS_Uint auto_start, int core_id)
160{
161#if HF_OS_FREERTOS_SMP
162 os_thread_start_t *params =
163 (os_thread_start_t *)pvPortMalloc(sizeof(os_thread_start_t));
164 if (!params) return 1;
165 params->entry = entry;
166 params->arg = input;
167 const BaseType_t affinity =
168 (core_id < 0) ? tskNO_AFFINITY : (BaseType_t)core_id;
169 BaseType_t res = xTaskCreatePinnedToCore(os_thread_start_trampoline, name,
170 stack_size / sizeof(StackType_t),
171 params, priority, t, affinity);
172 if (res != pdPASS) {
173 vPortFree(params);
174 return 1;
175 }
176 if (!auto_start)
177 vTaskSuspend(*t);
178 return OS_SUCCESS;
179#else
180 (void)core_id;
181 return os_thread_create(t, name, entry, input, stack, stack_size,
182 priority, preempt, slice, auto_start);
183#endif
184}
185
187static inline int os_get_current_core_id(void)
188{
189#if HF_OS_FREERTOS_SMP
190 return (int)xPortGetCoreID();
191#else
192 return 0;
193#endif
194}
195
196static inline OS_Uint os_thread_resume(OS_Thread *t) { vTaskResume(*t); return OS_SUCCESS; }
197static inline OS_Uint os_thread_suspend(OS_Thread *t) { vTaskSuspend(*t); return OS_SUCCESS; }
198static inline OS_Uint os_thread_delete(OS_Thread *t) { vTaskDelete(*t); return OS_SUCCESS; }
199static inline OS_Uint os_thread_terminate(OS_Thread *t){ vTaskDelete(*t); return OS_SUCCESS; }
201{
202 if (state)
203 *state = eTaskGetState(*t);
204 return OS_SUCCESS;
205}
206static inline OS_Uint os_thread_sleep(OS_Ulong ticks) { vTaskDelay(ticks); return OS_SUCCESS; }
207static inline OS_Uint os_thread_yield(void)
208{ taskYIELD(); return OS_SUCCESS; }
209static inline int os_kernel_is_running(void)
210{ return xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED; }
212{ return (t != 0 && *t != 0 && xTaskGetCurrentTaskHandle() == *t) ? 1u : 0u; }
213
215enum {
218 OS_THREAD_BLOCKED = eBlocked
220
221static inline int os_thread_is_live(const OS_Thread *t)
222{
223 return (t != 0) && (*t != 0);
224}
225static inline void os_thread_clear(OS_Thread *t)
226{
227 if (t) {
228 *t = 0;
229 }
230}
231static inline int os_mutex_is_live(const OS_Mutex *m)
232{
233 return (m != 0) && (*m != 0);
234}
235static inline int os_thread_state_is_suspended(OS_Uint state)
236{
237 return (state == (OS_Uint)eSuspended) || (state == (OS_Uint)eBlocked);
238}
239
240/* Mutex wrappers ---------------------------------------------------------*/
241static inline OS_Uint os_mutex_create(OS_Mutex *m, const char *name, OS_Uint inherit)
242{
243 (void)name;
244 (void)inherit;
245 *m = xSemaphoreCreateMutex();
246 return (*m) ? (OS_Uint)OS_SUCCESS : (OS_Uint)1;
247}
248static inline OS_Uint os_mutex_get(OS_Mutex *m, OS_Ulong wait) { return xSemaphoreTake(*m, wait) ? (OS_Uint)OS_SUCCESS : (OS_Uint)1; }
249static inline OS_Uint os_mutex_put(OS_Mutex *m) { return xSemaphoreGive(*m) ? (OS_Uint)OS_SUCCESS : (OS_Uint)1; }
250static inline OS_Uint os_mutex_delete(OS_Mutex *m) { vSemaphoreDelete(*m); return OS_SUCCESS; }
251
252/* Recursive Mutex wrappers -----------------------------------------------*/
253static inline OS_Uint os_recursive_mutex_create(OS_Mutex *m, const char *name)
254{
255 (void)name;
256 *m = xSemaphoreCreateRecursiveMutex();
257 return (*m) ? (OS_Uint)OS_SUCCESS : (OS_Uint)1;
258}
259static inline OS_Uint os_recursive_mutex_get(OS_Mutex *m, OS_Ulong wait) { return xSemaphoreTakeRecursive(*m, wait) == pdTRUE ? (OS_Uint)OS_SUCCESS : (OS_Uint)1; }
260static inline OS_Uint os_recursive_mutex_put(OS_Mutex *m) { return xSemaphoreGiveRecursive(*m) == pdTRUE ? (OS_Uint)OS_SUCCESS : (OS_Uint)1; }
261static inline OS_Uint os_recursive_mutex_delete(OS_Mutex *m) { vSemaphoreDelete(*m); return OS_SUCCESS; }
262
263/* Semaphore wrappers -----------------------------------------------------*/
264static inline OS_Uint os_semaphore_create(OS_Semaphore *s, const char* name, OS_Uint initial)
265{
266 (void)name;
267 *s = xSemaphoreCreateCounting(UINT16_MAX, initial);
268 return (*s) ? (OS_Uint)OS_SUCCESS : (OS_Uint)1;
269}
270static inline OS_Uint os_semaphore_delete(OS_Semaphore *s) { vSemaphoreDelete(*s); return OS_SUCCESS; }
271static inline OS_Uint os_semaphore_put(OS_Semaphore *s) { return xSemaphoreGive(*s) ? (OS_Uint)OS_SUCCESS : (OS_Uint)1; }
272static inline OS_Uint os_semaphore_get(OS_Semaphore *s, OS_Ulong wait) { return xSemaphoreTake(*s, wait) ? (OS_Uint)OS_SUCCESS : (OS_Uint)1; }
274{
275 if (count)
276 *count = uxSemaphoreGetCount(*s);
277 return OS_SUCCESS;
278}
279
280/* Queue wrappers ---------------------------------------------------------
281 * os_queue_create(q, name, item_words, store, length) creates a queue of
282 * @p length items of @p item_words 32-bit words each, as on every backend.
283 * @p store must hold OS_QUEUE_STORE_BYTES(item_words, length) bytes. With
284 * static allocation the kernel's StaticQueue_t is placed at the start of
285 * @p store and the items follow, so the queue never touches the kernel heap.
286 * Without configSUPPORT_STATIC_ALLOCATION the queue falls back to
287 * xQueueCreate() with the same item size and length, and @p store is unused. */
288#if defined(configSUPPORT_STATIC_ALLOCATION) && (configSUPPORT_STATIC_ALLOCATION == 1)
289# define HF_OS_FREERTOS_STATIC_QUEUE 1
291# define HF_OS_FREERTOS_QUEUE_ALIGN (2U * sizeof(void *))
293# define OS_QUEUE_STORE_BYTES(item_words, length) \
294 ((HF_OS_FREERTOS_QUEUE_ALIGN - 1U) + sizeof(StaticQueue_t) + \
295 (size_t)(item_words) * sizeof(uint32_t) * (size_t)(length))
296#else
297# define HF_OS_FREERTOS_STATIC_QUEUE 0
298# define OS_QUEUE_STORE_BYTES(item_words, length) ((size_t)0)
299#endif
300
301static inline OS_Uint os_queue_create(OS_Queue *q, const char* name, OS_Uint item_words,
302 void* store, OS_Ulong length)
303{
304 (void)name;
305 *q = NULL;
306 const size_t item_size = (size_t)item_words * sizeof(uint32_t);
307 if (item_size == 0U || length == 0U)
308 return 1;
309#if HF_OS_FREERTOS_STATIC_QUEUE
310 if (store == NULL)
311 return 1;
312 const uintptr_t align = (uintptr_t)HF_OS_FREERTOS_QUEUE_ALIGN;
313 const uintptr_t cb = ((uintptr_t)store + align - 1U) & ~(align - 1U);
314 *q = xQueueCreateStatic((UBaseType_t)length, (UBaseType_t)item_size,
315 (uint8_t *)(cb + sizeof(StaticQueue_t)), (StaticQueue_t *)cb);
316#else
317 (void)store;
318 *q = xQueueCreate((UBaseType_t)length, (UBaseType_t)item_size);
319#endif
320 return (*q) ? (OS_Uint)OS_SUCCESS : (OS_Uint)1;
321}
322static inline OS_Uint os_queue_delete(OS_Queue *q) { vQueueDelete(*q); return OS_SUCCESS; }
323static inline OS_Uint os_queue_send(OS_Queue *q, void *msg, OS_Ulong wait) { return xQueueSend(*q, msg, wait) ? (OS_Uint)OS_SUCCESS : (OS_Uint)1; }
324static inline OS_Uint os_queue_receive(OS_Queue *q, void *msg, OS_Ulong wait) { return xQueueReceive(*q, msg, wait) ? (OS_Uint)OS_SUCCESS : (OS_Uint)1; }
325
326/* Event group wrappers ---------------------------------------------------*/
327static inline OS_Uint os_event_group_create(OS_EventGroup *g, const char* name)
328{
329 (void)name;
330 *g = xEventGroupCreate();
331 return (*g) ? (OS_Uint)OS_SUCCESS : (OS_Uint)1;
332}
333static inline OS_Uint os_event_group_delete(OS_EventGroup *g) { vEventGroupDelete(*g); return OS_SUCCESS; }
335{ xEventGroupSetBits(*g, flags); return OS_SUCCESS; }
337{ xEventGroupClearBits(*g, flags); return OS_SUCCESS; }
348 OS_Ulong *actual, OS_Ulong wait)
349{
350 const int all = ((option & ~(OS_Uint)OS_EVENT_CLEAR) == (OS_Uint)OS_AND);
351 const int clear = (option & (OS_Uint)OS_EVENT_CLEAR) != 0U;
352 const EventBits_t want = (EventBits_t)flags;
353 const EventBits_t bits = xEventGroupWaitBits(*g, want, clear ? pdTRUE : pdFALSE,
354 all ? pdTRUE : pdFALSE, (TickType_t)wait);
355 if (actual)
356 *actual = bits;
357 const int met = all ? ((bits & want) == want) : ((bits & want) != 0U);
358 return met ? (OS_Uint)OS_SUCCESS : (OS_Uint)1;
359}
360
361/* Timer wrappers ---------------------------------------------------------*/
362typedef struct {
363 void (*cb)(OS_Ulong);
366
367static inline void os_timer_trampoline(TimerHandle_t timer)
368{
369 os_timer_cb_t *params = (os_timer_cb_t *)pvTimerGetTimerID(timer);
370 params->cb(params->id);
371}
372
373static inline OS_Uint os_timer_create(OS_Timer *t, const char *name,
374 void (*cb)(OS_Ulong), OS_Ulong id,
375 OS_Ulong initial, OS_Ulong reload,
376 OS_Uint auto_act)
377{
378 os_timer_cb_t *params = (os_timer_cb_t *)pvPortMalloc(sizeof(os_timer_cb_t));
379 if (!params) return 1;
380 params->cb = cb;
381 params->id = id;
382
383 *t = xTimerCreate(name, initial, reload != 0, (void *)params,
385 if (!*t) {
386 vPortFree(params);
387 return 1;
388 }
389 if (auto_act)
390 xTimerStart(*t, 0);
391 return OS_SUCCESS;
392}
394{
395 os_timer_cb_t *params = (os_timer_cb_t *)pvTimerGetTimerID(*t);
396 vPortFree(params);
397 xTimerDelete(*t, 0);
398 return OS_SUCCESS;
399}
400static inline OS_Uint os_timer_activate(OS_Timer *t) { return xTimerStart(*t,0)==pdPASS ? OS_SUCCESS:(OS_Uint)1; }
401static inline OS_Uint os_timer_deactivate(OS_Timer *t) { return xTimerStop(*t,0)==pdPASS ? OS_SUCCESS:(OS_Uint)1; }
402
403/* Stream buffer wrappers ------------------------------------------------*/
404static inline OS_Uint os_stream_buffer_create(OS_StreamBuffer *b, size_t capacity, size_t trigger)
405{
406 *b = xStreamBufferCreate(capacity, trigger);
407 return (*b) ? OS_SUCCESS : (OS_Uint)1;
408}
409static inline OS_Uint os_stream_buffer_delete(OS_StreamBuffer *b) { vStreamBufferDelete(*b); return OS_SUCCESS; }
410static inline OS_Uint os_stream_buffer_send(OS_StreamBuffer *b, const void *data, size_t len, OS_Ulong wait)
411{ return xStreamBufferSend(*b, data, len, wait) == len ? (OS_Uint)OS_SUCCESS : (OS_Uint)1; }
412static inline OS_Uint os_stream_buffer_receive(OS_StreamBuffer *b, void *data, size_t len, OS_Ulong wait)
413{ return xStreamBufferReceive(*b, data, len, wait) > 0 ? OS_SUCCESS : (OS_Uint)1; }
414
415/* Critical section wrappers ----------------------------------------------
416 * SMP kernels need an explicit spinlock; single-core kernels get mutual
417 * exclusion from the kernel's own ISR-masking critical section. The storage
418 * is declared in both flavors so CriticalSection.cpp stays flavor-neutral. */
419#if HF_OS_FREERTOS_SMP
420typedef portMUX_TYPE OS_Critical;
422static inline void os_critical_enter(void) { portENTER_CRITICAL(&os_critical_mux); }
423static inline void os_critical_exit(void) { portEXIT_CRITICAL(&os_critical_mux); }
424#else
426typedef uint8_t OS_Critical;
428static inline void os_critical_enter(void) { portENTER_CRITICAL(); }
429static inline void os_critical_exit(void) { portEXIT_CRITICAL(); }
430#endif
431
432#ifdef __cplusplus
433}
434#endif
void * OS_StreamBuffer
Definition os_cmsis.h:33
osEventFlagsId_t OS_EventGroup
Definition os_cmsis.h:31
unsigned int OS_Uint
Definition os_cmsis.h:36
osMessageQueueId_t OS_Queue
Definition os_cmsis.h:30
unsigned long OS_Ulong
Definition os_cmsis.h:35
osThreadId_t OS_Thread
Definition os_cmsis.h:27
osTimerId_t OS_Timer
Definition os_cmsis.h:32
uint8_t OS_Critical
Definition os_cmsis.h:426
osSemaphoreId_t OS_Semaphore
Definition os_cmsis.h:29
osMutexId_t OS_Mutex
Definition os_cmsis.h:28
static void os_critical_enter(void)
Definition os_freertos.h:428
static OS_Uint os_semaphore_put(OS_Semaphore *s)
Definition os_freertos.h:271
static OS_Uint os_queue_delete(OS_Queue *q)
Definition os_freertos.h:322
static OS_Uint os_thread_create_pinned(OS_Thread *t, const char *name, void(*entry)(OS_Ulong), OS_Ulong input, uint8_t *stack, OS_Ulong stack_size, OS_Uint priority, OS_Uint preempt, OS_Ulong slice, OS_Uint auto_start, int core_id)
Core-affinity variant of os_thread_create.
Definition os_freertos.h:154
static OS_Uint os_queue_create(OS_Queue *q, const char *name, OS_Uint item_words, void *store, OS_Ulong length)
Definition os_freertos.h:301
static int os_mutex_is_live(const OS_Mutex *m)
Definition os_freertos.h:231
static OS_Uint os_semaphore_get(OS_Semaphore *s, OS_Ulong wait)
Definition os_freertos.h:272
static void os_thread_start_trampoline(void *p)
Definition os_freertos.h:109
static OS_Uint os_thread_suspend(OS_Thread *t)
Definition os_freertos.h:197
static OS_Uint os_thread_resume(OS_Thread *t)
Definition os_freertos.h:196
static OS_Uint os_recursive_mutex_create(OS_Mutex *m, const char *name)
Definition os_freertos.h:253
static OS_Uint os_event_group_set(OS_EventGroup *g, OS_Ulong flags)
Definition os_freertos.h:334
static OS_Uint os_mutex_put(OS_Mutex *m)
Definition os_freertos.h:249
static OS_Uint os_event_group_get(OS_EventGroup *g, OS_Ulong flags, OS_Uint option, OS_Ulong *actual, OS_Ulong wait)
Wait for event bits.
Definition os_freertos.h:347
OS_Critical os_critical_mux
Definition CriticalSection.cpp:11
static OS_Uint os_semaphore_create(OS_Semaphore *s, const char *name, OS_Uint initial)
Definition os_freertos.h:264
EventGroupHandle_t OS_EventGroup
Definition os_freertos.h:81
static OS_Uint os_event_group_delete(OS_EventGroup *g)
Definition os_freertos.h:333
static int os_kernel_is_running(void)
Definition os_freertos.h:209
static OS_Uint os_mutex_get(OS_Mutex *m, OS_Ulong wait)
Definition os_freertos.h:248
static OS_Uint os_mutex_delete(OS_Mutex *m)
Definition os_freertos.h:250
static OS_Uint os_event_group_clear(OS_EventGroup *g, OS_Ulong flags)
Definition os_freertos.h:336
static OS_Uint os_semaphore_info_get(OS_Semaphore *s, OS_Ulong *count)
Definition os_freertos.h:273
static void os_critical_exit(void)
Definition os_freertos.h:429
SemaphoreHandle_t OS_Semaphore
Definition os_freertos.h:79
StreamBufferHandle_t OS_StreamBuffer
Definition os_freertos.h:83
static OS_Uint os_timer_create(OS_Timer *t, const char *name, void(*cb)(OS_Ulong), OS_Ulong id, OS_Ulong initial, OS_Ulong reload, OS_Uint auto_act)
Definition os_freertos.h:373
static int os_thread_is_live(const OS_Thread *t)
Definition os_freertos.h:221
static OS_Uint os_stream_buffer_send(OS_StreamBuffer *b, const void *data, size_t len, OS_Ulong wait)
Definition os_freertos.h:410
static OS_Uint os_thread_create(OS_Thread *t, const char *name, void(*entry)(OS_Ulong), OS_Ulong input, uint8_t *stack, OS_Ulong stack_size, OS_Uint priority, OS_Uint preempt, OS_Ulong slice, OS_Uint auto_start)
Definition os_freertos.h:116
unsigned int OS_Uint
Definition os_freertos.h:87
static void os_thread_clear(OS_Thread *t)
Definition os_freertos.h:225
static void os_timer_trampoline(TimerHandle_t timer)
Definition os_freertos.h:367
static OS_Uint os_queue_receive(OS_Queue *q, void *msg, OS_Ulong wait)
Definition os_freertos.h:324
static OS_Uint os_thread_delete(OS_Thread *t)
Definition os_freertos.h:198
static int os_get_current_core_id(void)
Definition os_freertos.h:187
@ OS_AUTO_START
Definition os_freertos.h:96
@ OS_SUCCESS
Definition os_freertos.h:92
@ OS_EVENT_CLEAR
Definition os_freertos.h:95
@ OS_DONT_START
Definition os_freertos.h:97
@ OS_INHERIT
Definition os_freertos.h:98
@ OS_OR
Definition os_freertos.h:94
@ OS_WAIT_FOREVER
Definition os_freertos.h:90
@ OS_AND
Definition os_freertos.h:93
@ OS_NO_WAIT
Definition os_freertos.h:91
static OS_Uint os_timer_deactivate(OS_Timer *t)
Definition os_freertos.h:401
static OS_Uint os_mutex_create(OS_Mutex *m, const char *name, OS_Uint inherit)
Definition os_freertos.h:241
unsigned long OS_Ulong
Definition os_freertos.h:86
static OS_Uint os_recursive_mutex_put(OS_Mutex *m)
Definition os_freertos.h:260
static OS_Uint os_recursive_mutex_delete(OS_Mutex *m)
Definition os_freertos.h:261
static OS_Uint os_stream_buffer_receive(OS_StreamBuffer *b, void *data, size_t len, OS_Ulong wait)
Definition os_freertos.h:412
uint8_t OS_Critical
Definition os_freertos.h:426
static OS_Uint os_timer_activate(OS_Timer *t)
Definition os_freertos.h:400
static OS_Uint os_stream_buffer_delete(OS_StreamBuffer *b)
Definition os_freertos.h:409
static OS_Uint os_thread_terminate(OS_Thread *t)
Definition os_freertos.h:199
@ OS_THREAD_READY
Definition os_freertos.h:216
@ OS_THREAD_BLOCKED
Definition os_freertos.h:218
@ OS_THREAD_SUSPENDED
Definition os_freertos.h:217
static OS_Uint os_thread_yield(void)
Definition os_freertos.h:207
static OS_Ulong os_time_get(void)
Definition os_freertos.h:101
TaskHandle_t OS_Thread
Definition os_freertos.h:77
static OS_Uint os_event_group_create(OS_EventGroup *g, const char *name)
Definition os_freertos.h:327
TimerHandle_t OS_Timer
Definition os_freertos.h:82
static OS_Uint os_queue_send(OS_Queue *q, void *msg, OS_Ulong wait)
Definition os_freertos.h:323
static OS_Uint os_recursive_mutex_get(OS_Mutex *m, OS_Ulong wait)
Definition os_freertos.h:259
static OS_Uint os_thread_is_current(const OS_Thread *t)
Definition os_freertos.h:211
static OS_Uint os_thread_sleep(OS_Ulong ticks)
Definition os_freertos.h:206
SemaphoreHandle_t OS_Mutex
Definition os_freertos.h:78
static int os_thread_state_is_suspended(OS_Uint state)
Definition os_freertos.h:235
static OS_Uint os_timer_delete(OS_Timer *t)
Definition os_freertos.h:393
static OS_Uint os_stream_buffer_create(OS_StreamBuffer *b, size_t capacity, size_t trigger)
Definition os_freertos.h:404
QueueHandle_t OS_Queue
Definition os_freertos.h:80
static OS_Uint os_semaphore_delete(OS_Semaphore *s)
Definition os_freertos.h:270
static OS_Uint os_thread_info_get(OS_Thread *t, OS_Uint *state)
Definition os_freertos.h:200
unsigned long OS_Ulong
Definition os_none.h:34
Definition os_freertos.h:104
OS_Ulong arg
Definition os_freertos.h:106
void(* entry)(OS_Ulong)
Definition os_freertos.h:105
Definition os_freertos.h:362
OS_Ulong id
Definition os_freertos.h:364
void(* cb)(OS_Ulong)
Definition os_freertos.h:363