osSetTaskPriority function
Declaration:
BOOL osSetTaskPriority(
  HANDLE Handle,
  UINT8 Priority
);
Parameters:
Handle

A handle to the task whose priority is to be modified.

Priority

The new priority level for the task. This value ranges from 0 (the highest priority) up to the value defined in the OS_LOWEST_USED_PRIORITY constant. The value cannot exceed 254.

Return value:

Returns TRUE on success or FALSE on failure. Use the osGetLastError function to retrieve extended error information.

Description:

This function assigns a new priority level to the specified task.

This function can be invoked prior to system startup, from within an interrupt service routine, or by a running task. If the new priority is higher than the priority of the current task, the specified task will be executed immediately. When called from an interrupt handler, the scheduler will determine the highest priority task to run once the interrupt handler has completed execution.

This function is available only when the OS_TASK_PRIORITY_FUNC constant is set to 1. If this functionality is not required, it can be disabled to reduce the size of the output code.

Version:1.0
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