Task Support
2-9
Operating System Abstraction API
Set Task Priority
TaskSetPri
Syntax
int TaskSetPri( HANDLE hTask, int Priority );
Parameter(s)
hTask
Handle to target task
Priority
Task priority level
Return Value
Previous task priority level
Description
Sets the priority of the target task to the specified value. The value of Priority
is constrained only by the size of an int on the target environment, but a range
of 0 to 15 is recommended. 0 is the lowest priority and should be reserved for
an idle task. If the specified priority is negative, the task is blocked.
Calling this function may cause a task switch.
Sleep Task for Period of Time
TaskSleep
Syntax
void TaskSleep( UINT32 Delay );
Parameter(s)
Delay
Time (in milliseconds) of sleep
Return Value
nothing
Description
Sleeps the calling task for a period of time as supplied in Delay. The sleep time
can not be zero.
Calling this function may cause a task switch.
Yield Execution to Another Task Thread
TaskYield
Syntax
void TaskYield();
Parameter(s)
none
Return Value
none
Description
This function is used to yield execution to another thread. Its only function is
to cause a round-robin task switch among “ready” task threads executing at
the same priority level.
This function always causes a task switch, however the original calling task
may be the next to execute.