Echelon Neuron C User Manual

Page 56

Advertising
background image

36

Compiler Directives

#pragma specify_io_clock

string

Specify this directive to inform the compiler of the value of the Neuron clock
speed (external crystal frequency for Series 3100 devices, or the I/O clock

frequency for Series 5000 devices).
The directive is generally not required for Series 5000 chips because the I/O
clock frequency is fixed for those chips.
This directive is only useful in combination with the sci I/O model, and
permits the compiler to calculate the register settings for the SCI I/O

hardware in any Neuron Chip or Smart Transceiver equipped with SCI I/O

hardware. The clock rate is specified with a string constant following the
pragma name as shown. The only clock rates that may be used with SCI I/O

hardware are “20 MHz”, “10 MHz”, “6.5536 MHz”, “5 MHz”, and “2.5 MHz”.

The strings must appear exactly as shown, including capitalization.

This directive is not supported in model files.

#pragma system_image_extensions nv_length_override

This directive enables the NV length override system image extension. This
system image extension is used to implement changeable network variable

types. You must provide an extension function named

get_nv_length_override() as detailed below. Using this compiler directive
together with a version of the Neuron firmware that does not support system

extensions will cause a linker error (NLD#477).

You can continue to access the nv_len property as discussed in the

Neuron C

Programmer’s Guide

. However, the Neuron C Version 2.1 (and later) system

image extension technique provides a more robust implementation and

should therefore be used for all new designs.
Where #pragma system_image_extensions nv_length_override enables the
nv_length_override system image extension, you must also provide the

system extension. To do so, you must implement a function that meets the

following prototype:

unsigned get_nv_length_override(unsigned nvIndex);


The function returns the current length in bytes of the network variable with

the given index, or 0xFF to signal that the length has not been changed. You
must maintain information about the current length (and type) for network

variables with changeable types in some appropriate, persistent, variable.

You can use the sizeof( ) operator to obtain the initial size of the network
variable. See the discussion on

Changeable Type Network Variables

in the

chapter

How Devices Communicate Using Network Variables

of the

Neuron

C Programmer's Guide

for more information.

This directive is not supported in model files.

#pragma transaction_by_address_off
#pragma transaction_by_address_on

These pragmas explicitly control which version of transaction ID allocation

algorithm the Neuron firmware uses. Some versions of the Neuron firmware

support a new version of transaction ID allocation that has superior duplicate
rejection properties. For the Neuron 3150 Chip, 3150 Smart Transceiver,

Advertising