Go to the documentation of this file.
29 #ifndef _OS_PORT_SAFERTOS_H
30 #define _OS_PORT_SAFERTOS_H
33 #include "SafeRTOS_API.h"
36 #define OS_INVALID_TASK_ID NULL
38 #define OS_SELF_TASK_ID NULL
41 #ifndef OS_TASK_PRIORITY_NORMAL
42 #define OS_TASK_PRIORITY_NORMAL (taskIDLE_PRIORITY + 1)
46 #ifndef OS_TASK_PRIORITY_HIGH
47 #define OS_TASK_PRIORITY_HIGH (taskIDLE_PRIORITY + 2)
51 #ifndef OS_MS_TO_SYSTICKS
52 #define OS_MS_TO_SYSTICKS(n) (n)
56 #ifndef OS_SYSTICKS_TO_MS
57 #define OS_SYSTICKS_TO_MS(n) (n)
61 #ifndef osGetSystemTime64
62 #define osGetSystemTime64() osGetSystemTime()
71 #if defined(portENTER_SWITCHING_ISR)
72 #define osEnterIsr() portENTER_SWITCHING_ISR()
78 #if defined(__XTENSA__)
79 #define osExitIsr(flag) if(flag) portYIELD_FROM_ISR()
80 #elif defined(portEXIT_SWITCHING_ISR)
81 #define osExitIsr(flag) portEXIT_SWITCHING_ISR()
82 #elif defined(portEND_SWITCHING_ISR)
83 #define osExitIsr(flag) portEND_SWITCHING_ISR(flag)
84 #elif defined(portYIELD_FROM_ISR)
85 #define osExitIsr(flag) portYIELD_FROM_ISR(flag)
87 #define osExitIsr(flag)
91 #ifndef configSUPPORT_STATIC_ALLOCATION
92 #define configSUPPORT_STATIC_ALLOCATION 0
125 #ifdef OS_TASK_PRIVATE_PARAMS
126 OS_TASK_PRIVATE_PARAMS
138 portInt8Type buffer[portQUEUE_OVERHEAD_BYTES * 2];
149 portInt8Type buffer[portQUEUE_OVERHEAD_BYTES * 2];
160 portInt8Type buffer[portQUEUE_OVERHEAD_BYTES * 2];
void osDelayTask(systime_t delay)
Delay routine.
void osStartKernel(void)
Start kernel.
void osDeleteTask(OsTaskId taskId)
Delete a task.
void osReleaseSemaphore(OsSemaphore *semaphore)
Release the specified semaphore object.
void osResumeAllTasks(void)
Resume scheduler activity.
bool_t osWaitForSemaphore(OsSemaphore *semaphore, systime_t timeout)
Wait for the specified semaphore to be available.
void osResetEvent(OsEvent *event)
Set the specified event object to the nonsignaled state.
bool_t osWaitForEvent(OsEvent *event, systime_t timeout)
Wait until the specified event is in the signaled state.
void * osAllocMem(size_t size)
Allocate a memory block.
bool_t osCreateMutex(OsMutex *mutex)
Create a mutex object.
bool_t osCreateSemaphore(OsSemaphore *semaphore, uint_t count)
Create a semaphore object.
void osAcquireMutex(OsMutex *mutex)
Acquire ownership of the specified mutex object.
OsTaskId osCreateTask(const char_t *name, OsTaskCode taskCode, void *arg, const OsTaskParameters *params)
Create a task.
mutex_t OsMutex
Mutex object.
void(* OsTaskCode)(void *arg)
Task routine.
void osDeleteSemaphore(OsSemaphore *semaphore)
Delete a semaphore object.
void osSwitchTask(void)
Yield control to the next task.
binary_semaphore_t OsEvent
Event object.
void osDeleteMutex(OsMutex *mutex)
Delete a mutex object.
bool_t osCreateEvent(OsEvent *event)
Create an event object.
void osDeleteEvent(OsEvent *event)
Delete an event object.
bool_t osSetEventFromIsr(OsEvent *event)
Set an event object to the signaled state from an interrupt service routine.
portTaskHandleType OsTaskId
Task identifier.
const OsTaskParameters OS_TASK_DEFAULT_PARAMS
void osInitKernel(void)
Kernel initialization.
uint32_t systime_t
System time.
void osSetEvent(OsEvent *event)
Set the specified event object to the signaled state.
void osFreeMem(void *p)
Release a previously allocated memory block.
void osReleaseMutex(OsMutex *mutex)
Release ownership of the specified mutex object.
portUnsignedBaseType priority
thread_t * OsTaskId
Task identifier.
void osSuspendAllTasks(void)
Suspend scheduler activity.
uint32_t systime_t
System time.
systime_t osGetSystemTime(void)
Retrieve system time.
semaphore_t OsSemaphore
Semaphore object.