Main Page   Modules   Data Structures   File List   Globals  

Task Management


Modules

Internal Task Management Functions

Defines

#define otosInterruptReturn()   otosScheduler(SCHED_NORM)
 Return from Interrupt.

#define otosBlock()   otosScheduler(SCHED_BLOCK)
 Block task for ever.


Functions

OtosTask * otosCreateTask (void(*pFunc)(void *), void *pArg, uint8_t prio, uint16_t stacksize, uint8_t name)
 Create a task.

OtosTask * otosGetRunningTask (void)
 Get pointer to the running task.

uint8_t otosSetPriority (uint8_t prio)
 Set the priority of the running task.


Detailed Description

Task Management

Define Documentation

 
#define otosBlock      otosScheduler(SCHED_BLOCK)
 

Block task for ever.

Definition at line 108 of file task.h.

Referenced by otosLockMutex(), otosReceiveEvent(), otosReceiveMessage(), and otosSleep().

 
#define otosInterruptReturn      otosScheduler(SCHED_NORM)
 

Return from Interrupt.

Call this as last instruction in an interrupt service routine if you want to call the otOS scheduler (e. g. if you sent some events to a task and you want to wake it immediately).

Definition at line 102 of file task.h.


Function Documentation

OtosTask* otosCreateTask void(*    pFunc)(void *),
void *    pArg,
uint8_t    prio,
uint16_t    stacksize,
uint8_t    name
 

Create a task.

If the created task has a priority higher than the running task, the new task is started immediately, else it is inserted in the ready queue.

Parameters:
pFunc Pointer to task function [void pFunc(void)]
pArg Arguments that are passed to the task function when it is started
prio Task priority [1..250]
stacksize Size of task's stack in bytes
name Task name (one character)
Returns:
Pointer to created task or NULL on error (out of memory)

Definition at line 113 of file task.c.

References otosAllocate(), otosInsertTaskInQueue(), and otosScheduler().

Referenced by main().

OtosTask* otosGetRunningTask void    [inline]
 

Get pointer to the running task.

Returns:
Pointer to running task

Definition at line 190 of file task.c.

References g_pRunningTask.

uint8_t otosSetPriority uint8_t    prio
 

Set the priority of the running task.

Parameters:
prio New priority
Returns:
The old priority of the running task

Definition at line 204 of file task.c.

References g_pRunningTask, and otosScheduler().


Generated on Sat Jan 25 18:41:43 2003 for otOS by doxygen1.3-rc2