#include <etimer/chEtimer.h>int timerSet(KnCap *actor, int timerLi, int flags, KnITimer *newit, KnITimer *oldit);
The function or functions documented here may not be used safely in all application contexts with all APIs provided in the ChorusOS 5.0 product.
See API(5FEA) for details.
timerSet() starts, cancels, or queries the state of timer timerli in actor actor. If actor has the value K_MYACTOR, the current actor is assumed.
KnTimeVal ITmReload ; /* Reload value (periodic timer) */ KnTimeVal ITmValue ; /* Initial value */
If newit is non-NULL, the timer is armed accordingly. ITmValue contains the initial timeout value while ITmReload contains the subsequent interval for a periodic timer, or zero for a one-shot timer. If the K_TIMER_ABSOLUTE bit is set in flags, ITmValue is interpreted as an absolute time value (in terms of the values returned by sysTime(2K)). Otherwise, ITmValue is interpreted as a relative time interval.
If the timer was already set, the previous setting is cancelled and replaced with the new specification. If ITmValue contains a zero value, the timer is disarmed.
If newit is NULL, the current timer setting is unchanged.
If oldit is non-NULL, the current setting of the timer (or zero if not set) is stored at the referenced location. A relative interval is always stored, even if the timer was armed by absolute time.
On successful completion, K_OK is returned. Otherwise, a negative error code is returned.
timerLi is not a valid timer identifier in the actor actor, or ITmReload or ITmValue are not valid KnTimeVal values.
An address argument falls outside the caller's address space.
See attributes(5) for descriptions of the following attributes:
|ATTRIBUTE TYPE||ATTRIBUTE VALUE|