Available Languages?:

OSA : OS_Task_SetPriority

OS_Task_SetPriority (OST_TASK_POINTER tp, char priority)

Set priority of task.

Before calling this service you should be sure that variable tp was initialized.

The macro this_task or the service OS_Task_GetCur() can be used to perform this operation on current task.

Call allowed:

Only in task

Parameters:

tp Pointer to task descriptor (OST_TASK_POINTER)
priority Task priority. Allowed values from 0 (highest) to 7 (lowest)

Returns:

nothing

Example:

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
        /*...*/
    }
}

Old style name

OS_SetTaskPriority

See also

 
en/osa/ref/allservices/os_task_setpriority.txt · Last modified: 07.10.2010 13:58 (external edit)
 
Creative Commons License Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki