PxDelaySched()
Schedule a delay job (task service).
- APPLIES TO
-
1.0.0
- SYNOPSIS
-
PxError_t PxDelaySched (PxDelay_t delayId, PxTicks_t ticks, void (*handler) (PxArg_t), PxArg_t arg); - ARGUMENTS
|
|
|
|
|
|
|
- RETURN VALUES
-
-
PXROS error code
-
- ERROR CODES
-
PXERR_DELAY_ILLDELAYdelayIdis not a valid delay handlerPXERR_REQUEST_ILLEGALThe caller task is not the requester of the
delayIdobjectPXERR_TASK_ILLCALLTask service called by the handler
- DESCRIPTION
-
PxDelaySchedcancels a potential delay job associated withdelayId. If ticks is not zero, PXROS schedules activation of the handler call handler(arg) after ticks PXROS ticks and associates this delay job withdelayIdobject. ThePxDelaySchedcan only be called from task level, otherwisePXERR_TASK_ILLCALLerror is returned.
- IMPLEMENTATION GUIDELINES
-
- Before call
-
-
delayIdmust be a valid PXROS-HR delay object created with aPxDelayRequestcall (V). The validity ofdelayIdmay also be checked by thePxDelayIsValidmacro (F). The delay object must be created on the same core as the caller runs on. The creator core id can be read with the macroPxDelayCoreIdand the own core id withPxGetCoreId(C). -
If
ticksis zero, the delay job identified bydelayIdis stopped. (C) -
The parameter
handlermust be a pointer to a valid function (V).
-
- After call
-
-
The function returns
PXERR_NOERRORif the delay job could be scheduled. Any other return value describes an error, which has to be interpreted (C).
-
- Best Practice
-
-
This function may be called from tasks only. (V)
-
- SEE ALSO
- USAGE
-
#include "pxdef.h" #define TICKS 0x500l PxError_t Err = PxDelaySched(delayId, TICKS, DelHandler, (PxArg_t) 0); if (Err != PXERR_NOERROR) { // Report error }