OS_Task_SetPriority (OST_TASK_POINTER tp, char priority)
Set priority of task.
The macro this_task or the service OS_Task_GetCur() can be used to perform this operation on current task.
Only in task
tp |
Pointer to task descriptor (OST_TASK_POINTER) |
priority |
Task priority. Allowed values from 0 (highest) to 7 (lowest) |
nothing
void Task (void) { for (;;) { /*...*/ OS_Task_SetPriority(this_task, 0); // Set highest priority /* Do time critical operations */ /*...*/ OS_Task_SetPriority(this_task, 7); // Set lowest priority /*...*/ } }
OS_SetTaskPriority