Compiler directives, Pragma directives – Echelon Neuron C User Manual

Page 40

Advertising
background image

20

Compiler Directives

Compiler Directives

ANSI C permits compiler extensions through the #pragma directive. These

directives are implementation-specific. The ANSI standard states that a
compiler can define any sort of language extensions through the use of these

directives. Unknown directives can be ignored or discarded. The Neuron C

Compiler issues warning messages for unrecognized directives.

In the Neuron C Compiler, pragmas can be used to set certain Neuron firmware

system resources and device parameters such as buffer counts and sizes and

receive transaction counts. See Chapter 8,

Memory Management,

of the

Neuron C Programmer’s Guide

for a detailed description of the compiler

directives for buffer allocation.

Other pragmas control code generation options, debugging options, error

reporting options, and other miscellaneous features. Additional #pragma

directives can be used to control other Neuron firmware-specific parameters.
These directives can appear anywhere in the source file.

Pragma Directives

The following pragma directives are defined in Neuron C Version 2.2:
#pragma all_bufs_offchip

This pragma is only used with the MIP/DPS. It causes the compiler to

instruct the firmware and the linker to place all application and network

buffers in off-chip RAM. This pragma is useful only on the Neuron 3150

®

Chip or 3150 Smart Transceiver, because these are the only parts that

support off-chip memory. See the

Microprocessor Interface Program (MIP)

User's Guide

for more information.

This directive is not supported in model files.

#pragma allow_duplicate_events

This directive causes the compiler to issue an NCC#176 duplicate event

message as a warning instead of as an error. The compiler normally treats a

duplicate event as a programming error. However, there are rare situations
where you want to test for a certain important event more than once within

the scheduler loop by having multiple, duplicated when clauses at different

points in the list of tasks run by the scheduler. This duplication can prevent
such an event from having to wait too long to be serviced. For more

information, see the discussion on

The Scheduler

in Chapter 7,

Additional

Features

, in the

Neuron C Programmer’s Guide

.

This directive is not supported in model files.

#pragma app_buf_in_count

count

[

, modifier

]

See

Allocating Buffers

in Chapter 8,

Memory Management,

of the

Neuron C

Programmer’s Guide

for detailed information on this pragma and its use.

This directive is not supported in model files.

Advertising