Atmel CAVR-4 Manual De Usuario

Descargar
Página de 323
CAVR-4
Part 2. Compiler reference
Pragma directives
217
#pragma bitfields
#pragma bitfields={reversed|default}
The 
#pragma
 
bitfields
 directive controls the order of bitfield members. 
By default, the AVR IAR C/C++ Compiler places bitfield members from the least 
significant bit to the most significant bit in the container type. Use the 
#pragma bitfields=reversed
 directive to place the bitfield members from the 
most significant to the least significant bit. This setting remains active until you turn it 
off again with the 
#pragma
 
bitfields=default
 directive.
#pragma constseg
The 
#pragma
 
constseg
 directive places constant variables in a named segment. Use 
the following syntax:
#pragma constseg=MY_CONSTANTS
const int factorySettings[] = {42, 15, -128, 0};
#pragma constseg=default
The segment name cannot be a predefined segment; see the chapter Segment reference 
for more information. 
The memory in which the segment resides is optionally specified using the following 
syntax:
#pragma constseg=_ _huge MyOtherSeg
All constants defined following this directive will be placed in the segment 
MyOtherSeg
 and accessed using huge addressing.
 #pragma data_alignment
#pragma data_alignment=expression
Use this pragma directive to give a variable a higher (more strict) alignment than it 
would otherwise have. It can be used on variables with static and automatic storage 
duration.
The value of the constant 
expression
 must be a power of two (1, 2, 4, etc.).
When you use 
#pragma
 
data_alignment
 on variables with automatic storage 
duration, there is an upper limit on the allowed alignment for each function, determined 
by the calling convention used.
#pragma dataseg
The 
#pragma
 
dataseg
 directive places variables in a named segment. Use the 
following syntax:
#pragma dataseg=MY_SEGMENT 
_ _no_init char myBuffer[1000];
#pragma dataseg=default