Go to the documentation of this file.
30 #define TRACE_LEVEL TRACE_LEVEL_OFF
88 if(params->
stack != NULL)
94 err = OSTaskCreateExt(taskCode, arg, stackTop, params->
priority,
96 OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);
99 if(err == OS_ERR_NONE)
147 n =
MIN(delay, 65535);
173 if(OSRunning == OS_TRUE)
188 if(OSRunning == OS_TRUE)
208 event->p = OSFlagCreate(0, &err);
211 if(event->
p != NULL && err == OS_ERR_NONE)
232 if(OSRunning == OS_TRUE)
235 OSFlagDel(event->
p, OS_DEL_ALWAYS, &err);
250 OSFlagPost(event->
p, 1, OS_FLAG_SET, &err);
264 OSFlagPost(event->
p, 1, OS_FLAG_CLR, &err);
286 OSFlagAccept(event->
p, 1, OS_FLAG_WAIT_SET_ANY | OS_FLAG_CONSUME, &err);
291 OSFlagPend(event->
p, 1, OS_FLAG_WAIT_SET_ANY | OS_FLAG_CONSUME, 0, &err);
302 n =
MIN(timeout, 65535);
304 OSFlagPend(event->
p, 1, OS_FLAG_WAIT_SET_ANY | OS_FLAG_CONSUME,
n, &err);
309 }
while(err == OS_ERR_TIMEOUT && timeout > 0);
313 if(err == OS_ERR_NONE)
336 OSFlagPost(event->
p, 1, OS_FLAG_SET, &err);
355 semaphore->
p = OSSemCreate(count);
358 if(semaphore->
p != NULL)
379 if(OSRunning == OS_TRUE)
382 OSSemDel(semaphore->
p, OS_DEL_ALWAYS, &err);
404 if(OSSemAccept(semaphore->
p) > 0)
410 err = OS_ERR_TIMEOUT;
416 OSSemPend(semaphore->
p, 0, &err);
427 n =
MIN(timeout, 65535);
429 OSSemPend(semaphore->
p,
n, &err);
434 }
while(err == OS_ERR_TIMEOUT && timeout > 0);
438 if(err == OS_ERR_NONE)
457 OSSemPost(semaphore->
p);
473 mutex->
p = OSMutexCreate(OS_PRIO_MUTEX_CEIL_DIS, &err);
476 if(mutex->
p != NULL && err == OS_ERR_NONE)
497 if(OSRunning == OS_TRUE)
500 OSMutexDel(mutex->
p, OS_DEL_ALWAYS, &err);
515 OSMutexPend(mutex->
p, 0, &err);
527 OSMutexPost(mutex->
p);
568 size, (uintptr_t)
p);
586 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.
void osSetEvent(OsEvent *event)
Set the specified event object to the signaled state.
bool_t osWaitForSemaphore(OsSemaphore *semaphore, systime_t timeout)
Wait for the specified semaphore to be available.
void osDelayTask(systime_t delay)
Delay routine.
__weak_func void osFreeMem(void *p)
Release a previously allocated memory block.
RTOS abstraction layer (Micrium uC/OS-II)
void osStartKernel(void)
Start kernel.
void osReleaseSemaphore(OsSemaphore *semaphore)
Release the specified semaphore object.
#define OS_INVALID_TASK_ID
void osSwitchTask(void)
Yield control to the next task.
bool_t osSetEventFromIsr(OsEvent *event)
Set an event object to the signaled state from an interrupt service routine.
bool_t osWaitForEvent(OsEvent *event, systime_t timeout)
Wait until the specified event is in the signaled state.
void osInitKernel(void)
Kernel initialization.
void(* OsTaskCode)(void *arg)
Task routine.
bool_t osCreateMutex(OsMutex *mutex)
Create a 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 osAcquireMutex(OsMutex *mutex)
Acquire ownership of the specified mutex object.
void osResumeAllTasks(void)
Resume scheduler activity.
bool_t osCreateEvent(OsEvent *event)
Create an event object.
void osDeleteSemaphore(OsSemaphore *semaphore)
Delete a semaphore object.
void osSuspendAllTasks(void)
Suspend scheduler activity.
uint32_t systime_t
System time.
void osDeleteEvent(OsEvent *event)
Delete an event object.
OsTaskId osCreateTask(const char_t *name, OsTaskCode taskCode, void *arg, const OsTaskParameters *params)
Create a task.
__weak_func void * osAllocMem(size_t size)
Allocate a memory block.
void osReleaseMutex(OsMutex *mutex)
Release ownership of the specified mutex object.
const OsTaskParameters OS_TASK_DEFAULT_PARAMS
void osDeleteTask(OsTaskId taskId)
Delete a task.
void osDeleteMutex(OsMutex *mutex)
Delete a mutex object.
thread_t * OsTaskId
Task identifier.
systime_t osGetSystemTime(void)
Retrieve system time.