PxTaskSuspend_Hnd()
Prevent a task from being scheduled (handler service).
- APPLIES TO
-
8.2.0
- SYNOPSIS
-
PxError_t PxTaskSuspend_Hnd (PxTask_t TaskId); - ARGUMENTS
|
- RETURN VALUES
-
-
PXROS error code
-
- ERROR CODES
-
PXERR_ACCESS_RIGHTthe calling task has not the right to suspend other tasks
PXERR_GLOBAL_ILLEGAL_COREthe requested task is not on the same core
PXERR_TASK_ILLRDYFUNinvalid ready function detected
PXERR_TASK_ILLTASKTaskIdis not a valid task object - DESCRIPTION
-
PxTaskSuspend_Hndsuspends task, i.e., prevents task from being scheduled. If the task is waiting for a resource, the resource may eventually be delivered to task but task remains in a waiting state until resumed byPxTaskResume. This function can only be called from handler.
- 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).
-
- After call
-
-
The function returns
PXERR_NOERRORif the task could be suspended. Any other return value describes an error, which has to be interpreted (C).
-
- Best Practice
-
-
This function should be called from handlers only. (V)
-
- SEE ALSO
- USAGE
-
#include "pxdef.h" PxError_t err = PxTaskSuspend_Hnd(TaskId); if (err != PXERR_NOERROR) { // Report error }