A SERVICE OF

logo

CAVR-4
Contents
xi
Writing efficient code .........................................................................130
Saving stack space and RAM memory ............................................131
Function prototypes ..........................................................................131
Integer types and bit negation ..........................................................132
Protecting simultaneously accessed variables ..................................132
Accessing special function registers ................................................133
Non-initialized variables ..................................................................134
Part 2. Compiler reference ....................................................135
Data representation ...................................................................................... 137
Alignment ................................................................................................137
Alignment in the AVR IAR C/C++ Compiler .................................137
Basic data types ....................................................................................138
Integer types .....................................................................................138
Floating-point types ........................................................................139
Pointer types ..........................................................................................141
Function pointers ..............................................................................141
Data pointers ....................................................................................141
Casting .............................................................................................142
Structure types ......................................................................................143
Alignment .........................................................................................143
General layout .................................................................................143
Type and object attributes ...............................................................144
Type attributes ..................................................................................144
Object attributes ...............................................................................145
Declaring objects in source files ......................................................146
Declaring objects volatile ................................................................146
Data types in C++ .................................................................................147
Segment reference ......................................................................................... 149
Summary of segments ......................................................................149
Descriptions of segments ..................................................................151