Valid contexts – Comtrol eCos User Manual
Page 64

Alarms
Alarms can be temporarily disabled and reenabled using
cyg_alarm_disable
and
cyg_alarm_enable
. Alter-
natively another call to
cyg_alarm_initialize
can be used to modify the behaviour of an existing alarm. If an
alarm is no longer required then the associated resources can be released using
cyg_alarm_delete
.
The alarm function is invoked when a counter tick occurs, in other words when there is a call to
cyg_counter_tick
, and will happen in the same context. If the alarm is associated with the system’s real-time
clock then this will be DSR context, following a clock interrupt. If the alarm is associated with some other
application-specific counter then the details will depend on how that counter is updated.
If two or more alarms are registered for precisely the same counter tick, the order of execution of the alarm functions
is unspecified.
Valid contexts
cyg_alarm_create
cyg_alarm_initialize
is typically called during system initialization but may
also be called in thread context. The same applies to
cyg_alarm_delete
.
cyg_alarm_initialize
,
cyg_alarm_disable
and
cyg_alarm_enable
may be called during initialization or from thread or DSR
context, but
cyg_alarm_enable
and
cyg_alarm_initialize
may be expensive operations and should only be
called when necessary.
64