PxTaskSetPrio()
Set task priority.
- APPLIES TO
-
8.2.0
- SYNOPSIS
-
PxError_t PxTaskSetPrio (PxTask_t taskid, PxPrio_t prio); - ARGUMENTS
|
|
|
- RETURN VALUES
-
-
PXROS error code
-
- ERROR CODES
-
PXERR_ACCESS_RIGHTThe calling task does not have the right to change the
prioof the taskPXERR_GLOBAL_ILLEGAL_COREThe requested task is not on the same core
PXERR_TASK_ILLPRIOpriois not a valid PXROS priorityPXERR_TASK_ILLTASKtaskidis not a valid task object - DESCRIPTION
-
This service gives task the priority
prio. If task is the calling tasks identifier andprioits current priority, the calling task is placed at the end of the appropriate ready list (i.e., scheduling is enforced).
- IMPLEMENTATION GUIDELINES
-
- Before call
-
-
The parameter
taskidmust be a valid task object id. This id may be-
the calling task’s own id read by calling
PxGetId()(V) -
the return value of a
PxTaskCreate()call (V) -
the result of a
nameserverquery (V) -
part of a message sent by another task (V)
-
-
The task object must be created on the same core as the caller runs on. The creator core id can be read with the macro
PxTaskCoreIdand the own core id withPxGetCoreId(C).Additionally the task id may be checked withPxTaskCheck()(F). -
prioshould be a plausible priority value (typically between 0 and 31) (V)
-
- After call
-
-
The function returns
PXERR_NOERRORif the task’s priority could be changed. Any other return value describes an error, which has to be interpreted (C).
-
- Best Practice
-
-
No restrictions.
-
- SEE ALSO
- USAGE
-
#include "pxdef.h" PxError_t err = PxTaskSetPrio(taskid, 10); if (err != PXERR_NOERROR) { // Report error }