Atmel CAVR-4 Manual De Usuario
![Atmel](https://files.manualsbrain.com/attachments/0369829915bda09f9c2e00fb805a7753579683b5/common/fit/150/50/8d2bf08978ec3e5bc63f4343ac5e91ce8d0e40045619fa520d910d64af8f/brand_logo.png)
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
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
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.
for more information.
The memory in which the segment resides is optionally specified using the following
syntax:
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.
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.
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