PRD_start
Application Program Interface
2-295
C Interface
Syntax
PRD_start(prd);
Parameters
PRD_Handle prd;
/* prd object handle*/
Return Value
Void
Reentrant
no
Description
PRD_start starts a period object that has its mode property set to one-
shot in the configuration. Unlike PRD objects that are configured as
continuous, one-shot PRD objects do not automatically continue to run.
A one-shot PRD object runs its function only after the specified number
of ticks have occurred after a call to PRD_start.
For example, you might have a function that should be executed a certain
number of periodic ticks after some condition is met.
When you use PRD_start to start a period object, the exact time the
function runs can vary by nearly one tick cycle. As Figure 2-10 shows,
PRD ticks occur at a fixed rate and the call to PRD_start can occur at any
point between ticks
Figure 2-10.
PRD Tick Cycles
If PRD_start is called again before the period for the object has elapsed,
the object’s tick count is reset. The PRD object does not run until its
"period" number of ticks have elapsed.
Example
/* ======== startPRD ======== */
Void startPrd(Int periodID)
{
if ("condition met") {
PRD_start(&periodID);
}
}
See Also
PRD_start
Arm a periodic function for one-shot execution
Tick
Tick
Tick
Time to first tick after PRD_start is called.