Go to the documentation of this file.
30 #define TRACE_LEVEL TRACE_LEVEL_OFF
80 Task_Params taskParams;
87 Task_Params_init(&taskParams);
88 taskParams.arg0 = (UArg) arg;
89 taskParams.stackSize = params->
stackSize *
sizeof(uint32_t);
90 taskParams.priority = params->
priority;
93 handle = Task_create((Task_FuncPtr) taskCode, &taskParams, &eb);
108 Task_delete(&taskId);
175 event->handle = Event_create(NULL, NULL);
200 Event_delete(&event->
handle);
213 Event_post(event->
handle, Event_Id_00);
225 Event_pend(event->
handle, Event_Id_00, Event_Id_NONE, BIOS_NO_WAIT);
246 ret = Event_pend(event->
handle, Event_Id_00,
247 Event_Id_NONE, BIOS_NO_WAIT);
252 ret = Event_pend(event->
handle, Event_Id_00,
253 Event_Id_NONE, BIOS_WAIT_FOREVER);
258 ret = Event_pend(event->
handle, Event_Id_00,
277 Event_post(event->
handle, Event_Id_00);
295 Semaphore_Params semaphoreParams;
298 Semaphore_Params_init(&semaphoreParams);
299 semaphoreParams.mode = Semaphore_Mode_COUNTING;
302 semaphore->
handle = Semaphore_create(count, &semaphoreParams, NULL);
305 if(semaphore->
handle != NULL)
324 if(semaphore->
handle != NULL)
327 Semaphore_delete(&semaphore->
handle);
348 ret = Semaphore_pend(semaphore->
handle, BIOS_NO_WAIT);
353 ret = Semaphore_pend(semaphore->
handle, BIOS_WAIT_FOREVER);
374 Semaphore_post(semaphore->
handle);
387 Semaphore_Params semaphoreParams;
390 Semaphore_Params_init(&semaphoreParams);
391 semaphoreParams.mode = Semaphore_Mode_BINARY_PRIORITY;
394 mutex->
handle = Semaphore_create(1, &semaphoreParams, NULL);
419 Semaphore_delete(&mutex->
handle);
432 Semaphore_pend(mutex->
handle, BIOS_WAIT_FOREVER);
444 Semaphore_post(mutex->
handle);
458 time = Clock_getTicks();
485 size, (uintptr_t)
p);
503 TRACE_DEBUG(
"Freeing memory at 0x%08" PRIXPTR
"\r\n", (uintptr_t)
p);
bool_t osCreateSemaphore(OsSemaphore *semaphore, uint_t count)
Create a semaphore object.
__weak_func void * osAllocMem(size_t size)
Allocate a memory block.
void osSwitchTask(void)
Yield control to the next task.
void osSetEvent(OsEvent *event)
Set the specified event object to the signaled state.
void osAcquireMutex(OsMutex *mutex)
Acquire ownership of the specified mutex object.
void osDeleteTask(OsTaskId taskId)
Delete a task.
__weak_func void osFreeMem(void *p)
Release a previously allocated memory block.
OsTaskId osCreateTask(const char_t *name, OsTaskCode taskCode, void *arg, const OsTaskParameters *params)
Create a task.
bool_t osWaitForEvent(OsEvent *event, systime_t timeout)
Wait until the specified event is in the signaled state.
RTOS abstraction layer (SYS/BIOS)
void(* OsTaskCode)(void *arg)
Task routine.
bool_t osCreateMutex(OsMutex *mutex)
Create a mutex object.
void osReleaseMutex(OsMutex *mutex)
Release ownership of the specified mutex object.
#define OS_SYSTICKS_TO_MS(n)
void osResetEvent(OsEvent *event)
Set the specified event object to the nonsignaled state.
bool_t osSetEventFromIsr(OsEvent *event)
Set an event object to the signaled state from an interrupt service routine.
void osInitKernel(void)
Kernel initialization.
#define OS_MS_TO_SYSTICKS(n)
void osDeleteSemaphore(OsSemaphore *semaphore)
Delete a semaphore object.
void osReleaseSemaphore(OsSemaphore *semaphore)
Release the specified semaphore object.
systime_t osGetSystemTime(void)
Retrieve system time.
void osDeleteEvent(OsEvent *event)
Delete an event object.
uint32_t systime_t
System time.
void osDelayTask(systime_t delay)
Delay routine.
bool_t osWaitForSemaphore(OsSemaphore *semaphore, systime_t timeout)
Wait for the specified semaphore to be available.
void osSuspendAllTasks(void)
Suspend scheduler activity.
bool_t osCreateEvent(OsEvent *event)
Create an event object.
thread_t * OsTaskId
Task identifier.
void osDeleteMutex(OsMutex *mutex)
Delete a mutex object.
void osResumeAllTasks(void)
Resume scheduler activity.
void osStartKernel(void)
Start kernel.