osSetTaskPriority function
BOOL osSetTaskPriority(
  HANDLE Handle,
  UINT8 Priority

A task handle.


New task priority. Its value can be in range from 0 (the highest priority) up to value defined in the OS_LOWEST_USED_PRIORITY constant. It cannot be higher than 254.

Return value:

TRUE on success or FALSE on failure. Use osGetLastError function to obtain extended error information.


Function sets the new value of the task priority.

This function may be called before system start, from an interrupt or by a task. When new priority is higher than priority of current task, the specified task will be executed immediately. If it is called from an interrupt handler, after finishing the interrupt handler, task with the highest priority will run.

Function is available only, when the value of OS_TASK_PRIORITY_FUNC constant is set to 1. When function is not used, it may be disabled to reduce the output code.

Header file:OS_Task.h (include OS_API.h)
See also: BOOL, FALSE, HANDLE, OS_LOWEST_USED_PRIORITY, OS_TASK_PRIORITY_FUNC, osGetLastError, tasks, TRUE, using priority and time quanta
SpaceShadow documentation