Functions | |
OtosTask * | otosCreateMainTask (uint8_t prio, uint16_t stacksize) |
Create the main task. The calling function will become the main task. | |
void | otosDispatch (OtosTask *pOldTask, OtosTask *pNewTask) |
Switch task context from pOldTask to pNewTask. | |
void | otosScheduler (uint8_t operation) |
Distribute CPU time. | |
void | otosWakeup (OtosTask *pTask) |
Wake up task. | |
void | otosInsertTaskInQueue (OtosTask *volatile *pQueue, OtosTask *pTask, uint8_t state) |
Insert task in a queue. | |
uint8_t | otosSetPreemtive (uint8_t timeSlice) |
Enable/disable preemtive multitasking. | |
uint8_t | otosGetPreemtive (void) |
Get status of preemtive multitasking. | |
OTOS_TASK_FUNCTION (idle, pArg) | |
The system idle task. | |
int | main (void) |
C entry point. |
|
C entry point. Initializes task handling and finally calls otosMain(), which is a function supplied by the otOS application.
Definition at line 594 of file task.c. References otosCreateMainTask(), otosCreateTask(), otosGetTicks(), otosInitHardware(), and otosSetRamBank(). |
|
The system idle task. This task is executed when there is no other task ready to run. This task must always be READY. It must have priority 0.
Definition at line 575 of file task.c. References otosScheduler(). |
|
Create the main task. The calling function will become the main task.
Definition at line 257 of file task.c. References g_pRunningTask, otosAllocate(), and otosError_P(). Referenced by main(). |
|
Switch task context from pOldTask to pNewTask.
Definition at line 344 of file task.c. Referenced by otosScheduler(). |
|
Get status of preemtive multitasking.
Definition at line 560 of file task.c. References g_timeSliceTicks. |
|
Insert task in a queue. The otOS task queues are sorted in order of descending priority, i.e. tasks with higher priority are inserted before tasks with lower priority. If more tasks have the same priority, a newly inserted task is inserted after all other tasks of the same priority.
Definition at line 499 of file task.c. Referenced by otosCreateTask(), otosScheduler(), and otosWakeup(). |
|
Distribute CPU time.
Definition at line 368 of file task.c. References g_performDispatch, g_pReadyQueue, g_pRunningTask, otosDispatch(), otosError(), otosGetTickDiff(), otosGetTicks(), and otosInsertTaskInQueue(). Referenced by OTOS_TASK_FUNCTION(), otosCreateTask(), otosSendEvent(), otosSendMessage(), otosSetPriority(), otosSleep(), otosUnlockMutex(), and SIGNAL(). |
|
Enable/disable preemtive multitasking.
Definition at line 533 of file task.c. References g_timeSliceCounter, and g_timeSliceTicks. |
|
Wake up task. Move pTask from blocked queue to ready queue. No task switch will occur.
Definition at line 456 of file task.c. References g_pBlockedQueue, otosError_P(), and otosInsertTaskInQueue(). Referenced by otosSendEventToOneTask(), otosSendMessage(), otosUnlockMutex(), and SIGNAL(). |