User guide

Neuron C Programmer’s Guide 19
Predefined Event Where Described in This Manual
msg_arrives Chapter 6
msg_completes Chapter 6
msg_fails Chapter 6
msg_succeeds Chapter 6
nv_update_occurs Chapter 3
nv_update_completes Chapter 3
nv_update_fails Chapter 3
nv_update_succeeds Chapter 3
offline Chapter 7
online Chapter 7
reset this chapter
resp_arrives Chapter 6
timer_expires this chapter
wink Chapter 7
A modifier that narrows the scope of the event may follow some predefined
events, such as the I/O events and network variable events. If the modifier is
optional and not supplied, any event of that type qualifies.
Predefined events can also be used as any sub-expression, including within the
control expression of if, while, and for statements. This method is termed
direct
event processing
. An example of direct event processing is:
mtimer t;
when (event)
{
. . .
if (timer_expires(t)) {
io_out(io_led, OFF);
}
. . .
}
Any built-in event keyword or keyword expression (such as timer_expires(t)) is
treated the same as any other sub-expression and any combination allowed by
standard C expression syntax is allowed when programming in Neuron C.
The special case of the io_changes event expression
must be treated carefully
.
The to and by qualifier keywords are treated as general expression operators for
purposes of precedence (although they are only permitted in combination with