PxDelaySched_Hnd()
Schedule a delay job (handler service).
- APPLIES TO
-
1.0.0
- SYNOPSIS
-
PxError_t PxDelaySched_Hnd (PxDelay_t delayId, PxTicks_t ticks, void (*handler) (PxArg_t), PxArg_t arg);
- ARGUMENTS
|
|
|
|
|
|
|
- RETURN VALUES
-
-
PXROS error code
-
- ERROR CODES
-
PXERR_DELAY_ILLDELAY
delayId
is not a valid delay handlerPXERR_REQUEST_ILLEGAL
The caller task is not the requester of the
delayId
objectPXERR_TASK_ILLCALL
Task service called by the handler
- DESCRIPTION
-
PxDelaySched_Hnd
cancels a potential delay job associated withdelayId
. Ifticks
is not zero, PXROS schedules activation of the handler call handler(arg
) after ticks PXROS ticks and associates this delay job withdelayId
object. ThePxDelaySched_Hnd
can only be called from handler level, otherwisePXERR_PXHND_ILLCALL
error is returned.
- IMPLEMENTATION GUIDELINES
-
- Before call
-
-
delayId
must be a valid PXROS-HR delay object created with aPxDelayRequest
call (V). The validity ofdelayId
may also be checked by thePxDelayIsValid
macro (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 macroPxDelayCoreId
and the own core id withPxGetCoreId
(C). -
If
ticks
is zero, the delay job identified bydelayId
is stopped. (C) -
The parameter
handler
must be a pointer to a valid function (V).
-
- After call
-
-
The function returns
PXERR_NOERROR
if 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 handlers only. (V)
-
- SEE ALSO
- USAGE
-
#include "pxdef.h" #define TICKS 0x500l PxError_t Err = PxDelaySched_Hnd(delayId, TICKS, DelHandler, (PxArg_t) 0); if (Err != PXERR_NOERROR) { // Report error }