Restrictions for using interrupts, Sleep mode – Echelon Neuron C User Manual

Page 177

Advertising
background image

Neuron C Programmer’s Guide

165

out, and the device resets. To avoid the watchdog timer reset, use the #pragma

deadlock_is_infinite compiler directive. Do not use this directive for release
targets; it is intended only for debug targets. See the

Neuron C Reference Guide

for information about this directive.

Restrictions for Using Interrupts

Networking activity is prohibited within an interrupt task, and from any function
called from the interrupt task. If the interrupt task calls a messaging or network

variable API, the system firmware logs an error and ensures that no other action

is taken. The messaging or network variable API call returns results that
indicate an error condition, such as “no new message available” or “no buffers

available.”

Declaring one or more interrupt tasks with target hardware that does not

support this hardware interrupts yields a linker error, NLD#506.
Declaring an interrupt task in pure-C mode yields a compiler error. That is, you
cannot create a binary library of interrupt tasks, just as you cannot use when-

tasks in a precompiled function library.

Sleep Mode

You can use

sleep mode

to place a Series 3100 Neuron Chip or Smart Transceiver

in a low-power state. To instruct a Series 3100 Neuron Chip or Smart

Transceiver to enter sleep mode, perform the following steps:
1

Flush all pending network variable updates as well as all outstanding
outgoing and incoming messages.

2

Put the Neuron Chip or Smart Transceiver into sleep mode after the

flush completes. The Neuron Chip or Smart Transceiver always wakes
up when the service pin is activated, or when there is activity on an I/O

pin (the pin selected is configurable) or on the communications channel,
or both.

Series 5000 chips do not support sleep mode.
Example:

mtimer m_30;
network output SNVT_switch nvoValue;
static SNVT_switch temp;

when (timer_exp(m_30))
{
nvoValue = temp;
flush(TRUE);
}

when (flush_completes)
{
sleep(COMM_IGNORE);
}

Advertising