Go to the documentation of this file.
30 #define TRACE_LEVEL TRACE_LEVEL_OFF
72 if(semaphoreTable[i] ==
FALSE)
75 semaphoreTable[i] =
TRUE;
103 semaphoreTable[id] =
FALSE;
118 osMemset(semaphoreTable, 0,
sizeof(semaphoreTable));
151 if(params->
fp != NULL)
157 if(params->
stack != NULL)
160 status = K_Task_Create_Stack(params->
priority, &slot, (CMX_FP) taskCode,
166 status = K_Task_Create(params->
priority, &slot, (CMX_FP) taskCode,
183 status = K_Task_Start(slot);
212 K_Task_Delete(taskId);
280 status = K_Semaphore_Create(event->
id, 0);
320 K_Semaphore_Post(event->
id);
337 status = K_Semaphore_Get(event->
id);
340 }
while(status == K_OK);
361 status = K_Semaphore_Get(event->
id);
366 status = K_Semaphore_Wait(event->
id, 0);
396 K_Intrp_Semaphore_Post(event->
id);
423 status = K_Semaphore_Create(semaphore->
id, count);
471 status = K_Semaphore_Get(semaphore->
id);
476 status = K_Semaphore_Wait(semaphore->
id, 0);
504 K_Semaphore_Post(semaphore->
id);
526 status = K_Semaphore_Create(mutex->
id, 0);
538 status = K_Semaphore_Post(mutex->
id);
573 K_Semaphore_Wait(mutex->
id, 0);
585 K_Semaphore_Post(mutex->
id);
599 time = K_OS_Tick_Get_Ctr();
626 size, (uintptr_t)
p);
644 TRACE_DEBUG(
"Freeing memory at 0x%08" PRIXPTR
"\r\n", (uintptr_t)
p);
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.
#define OS_INVALID_TASK_ID
__weak_func void osFreeMem(void *p)
Release a previously allocated memory block.
void osDeleteMutex(OsMutex *mutex)
Delete a mutex object.
void osReleaseSemaphore(OsSemaphore *semaphore)
Release the specified semaphore object.
void osReleaseMutex(OsMutex *mutex)
Release ownership of the specified mutex object.
bool_t osSetEventFromIsr(OsEvent *event)
Set an event object to the signaled state from an interrupt service routine.
__weak_func void * osAllocMem(size_t size)
Allocate a memory block.
uint8_t osAllocateSemaphoreId(void)
Allocate a new semaphore identifier.
void osAcquireMutex(OsMutex *mutex)
Acquire ownership of the specified mutex object.
bool_t osCreateSemaphore(OsSemaphore *semaphore, uint_t count)
Create a semaphore object.
bool_t osWaitForSemaphore(OsSemaphore *semaphore, systime_t timeout)
Wait for the specified semaphore to be available.
#define OS_MAX_SEMAPHORES
void(* OsTaskCode)(void *arg)
Task routine.
bool_t osCreateMutex(OsMutex *mutex)
Create a mutex object.
void osSetEvent(OsEvent *event)
Set the specified event object to the signaled state.
OsTaskId osCreateTask(const char_t *name, OsTaskCode taskCode, void *arg, const OsTaskParameters *params)
Create a task.
void osFreeSemaphoreId(uint8_t id)
Release semaphore identifier.
void osStartKernel(void)
Start kernel.
#define OS_SYSTICKS_TO_MS(n)
#define OS_MS_TO_SYSTICKS(n)
void osInitKernel(void)
Kernel initialization.
bool_t osCreateEvent(OsEvent *event)
Create an event object.
systime_t osGetSystemTime(void)
Retrieve system time.
const OsTaskParameters OS_TASK_DEFAULT_PARAMS
void osDeleteTask(OsTaskId taskId)
Delete a task.
uint32_t systime_t
System time.
void osDelayTask(systime_t delay)
Delay routine.
#define OS_INVALID_SEMAPHORE_ID
void osSwitchTask(void)
Yield control to the next task.
thread_t * OsTaskId
Task identifier.
RTOS abstraction layer (CMX-RTX)
#define osMemset(p, value, length)
void osDeleteEvent(OsEvent *event)
Delete an event object.
void osResumeAllTasks(void)
Resume scheduler activity.
void osDeleteSemaphore(OsSemaphore *semaphore)
Delete a semaphore object.
void osSuspendAllTasks(void)
Suspend scheduler activity.