Echelon Mini EVK User Manual

Page 44

Advertising
background image

Declarations using extern references can be used to provide forward

references to variables, and function prototypes must be declared to provide
forward references to functions.
Upon power-up or reset of a Neuron Chip or Smart Transceiver, the global
data in RAM is initialized to its initial-value expression, if present, otherwise

to zero (variables declared with the eeprom or config class, as well as

configuration properties declared with the config_prop or cp_family keywords,
are only initialized when the application image is first loaded).
Neuron C supports the following ANSI C storage classes and type qualifiers:
auto declares a variable of local scope. Typically, this would be within a

function body. This is the default storage class within a local scope and the

keyword is normally not specified. Variables of auto scope that are not also
static are not initialized upon entry to the local scope. The value of the

variable is not preserved once program execution leaves the scope.

const declares a value that cannot be modified by the application program.

Affects self-documentation (SD) data generated by the Neuron C compiler

when used in conjunction with the declaration of CP families or configuration
network variables. The Neuron C language does not permit the use of const

with auto.

extern declares a data item or function that is defined in another module, in a

library, or in the system image.

static declares a data item or function which is not to be made available to

other modules at link time. Furthermore, if the data item is local to a
function or to a when task, the data value is to be preserved between

invocations, and is not made available to other functions at compile time.

In addition to the ANSI C storage classes, Neuron C provides the following
classes and class modifiers:
network begins a network variable declaration. See Chapter 3, How

Devices Communicate Using Network Variables, of the Neuron C

Programmer’s Guide for more details.

uninit when combined with the eeprom keyword (see below), specifies

that the EEPROM variable is not initialized or altered on program load or

reload over the network.

The following Neuron C keywords allow you to direct portions of application
code and data to specific memory sections.
eeprom
far
offchip (only on Neuron Chips and Smart Transceivers with external

memory)

onchip
These keywords are particularly useful on the Neuron 3150 Chip and 3150

Smart Transceivers, since a majority of the address space for these parts is

mapped off chip. See Using Neuron Chip Memory in Chapter 8 of the Neuron C
Programmer’s Guide
for a more detailed description of memory usage and the
use of these keywords.

38

Mini EVK User’s Guide

Advertising