Go to the documentation of this file.
30 #define TRACE_LEVEL TRACE_LEVEL_OFF
92 if(params->
stack != NULL)
95 taskId = os_tsk_create_user_ex(taskCode, params->
priority, params->
stack,
96 params->
stackSize *
sizeof(uint32_t), arg);
101 taskId = os_tsk_create_ex(taskCode, params->
priority, arg);
120 os_tsk_delete_self();
125 os_tsk_delete((OS_TID) taskId);
146 n =
MIN(delay, 0xFFFE);
206 os_sem_init(event, 0);
249 res = os_sem_wait(event, 0);
252 }
while(
res == OS_R_OK);
274 res = os_sem_wait(event, 0xFFFF);
285 n =
MIN(timeout, 0xFFFE);
287 res = os_sem_wait(event,
n);
292 }
while(
res == OS_R_TMO && timeout > 0);
296 if(
res == OS_R_OK ||
res == OS_R_SEM)
302 res = os_sem_wait(event, 0);
305 }
while(
res == OS_R_OK);
347 os_sem_init(semaphore, count);
382 res = os_sem_wait(semaphore, 0xFFFF);
393 n =
MIN(timeout, 0xFFFE);
395 res = os_sem_wait(semaphore,
n);
400 }
while(
res == OS_R_TMO && timeout > 0);
404 if(
res == OS_R_OK ||
res == OS_R_SEM)
423 os_sem_send(semaphore);
463 os_mut_wait(mutex, 0xFFFF);
475 os_mut_release(mutex);
489 time = os_time_get();
516 size, (uintptr_t)
p);
534 TRACE_DEBUG(
"Freeing memory at 0x%08" PRIXPTR
"\r\n", (uintptr_t)
p);
RTOS abstraction layer (Keil RTX)
__weak_func void osFreeMem(void *p)
Release a previously allocated memory block.
void osDeleteEvent(OsEvent *event)
Delete an event object.
systime_t osGetSystemTime(void)
Retrieve system time.
__weak_func void * osAllocMem(size_t size)
Allocate a memory block.
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.
void osInitKernel(void)
Kernel initialization.
bool_t osCreateMutex(OsMutex *mutex)
Create a mutex object.
void osResumeAllTasks(void)
Resume scheduler activity.
bool_t osWaitForSemaphore(OsSemaphore *semaphore, systime_t timeout)
Wait for the specified semaphore to be available.
bool_t osSetEventFromIsr(OsEvent *event)
Set an event object to the signaled state from an interrupt service routine.
void osDeleteMutex(OsMutex *mutex)
Delete a mutex object.
void osReleaseSemaphore(OsSemaphore *semaphore)
Release the specified semaphore object.
void(* OsTaskCode)(void *arg)
Task routine.
void osReleaseMutex(OsMutex *mutex)
Release ownership of the specified mutex object.
bool_t osCreateSemaphore(OsSemaphore *semaphore, uint_t count)
Create a semaphore object.
#define OS_SYSTICKS_TO_MS(n)
#define OS_MS_TO_SYSTICKS(n)
void osDeleteTask(OsTaskId taskId)
Delete a task.
const OsTaskParameters OS_TASK_DEFAULT_PARAMS
void osSwitchTask(void)
Yield control to the next task.
void osDelayTask(systime_t delay)
Delay routine.
void osStartKernel(OsInitTaskCode task)
Start kernel.
uint32_t systime_t
System time.
void osResetEvent(OsEvent *event)
Set the specified event object to the nonsignaled state.
void osSetEvent(OsEvent *event)
Set the specified event object to the signaled state.
void osDeleteSemaphore(OsSemaphore *semaphore)
Delete a semaphore object.
void(* OsInitTaskCode)(void)
Initialization task.
thread_t * OsTaskId
Task identifier.
void osSuspendAllTasks(void)
Suspend scheduler activity.
bool_t osCreateEvent(OsEvent *event)
Create an event object.
bool_t osWaitForEvent(OsEvent *event, systime_t timeout)
Wait until the specified event is in the signaled state.