Atmel CAVR-4 ユーザーズマニュアル
CAVR-4
184
Descriptions of options
AVR® IAR C/C++ Compiler
Reference Guide
Then the following directories are searched in the order listed below for the file
config.h
, which in this example is located in the
dir\debugconfig
directory:
dir\include
Current file.
dir\src
File including current file.
dir\include
As specified with the first
-I
option.
dir\debugconfig
As specified with the second
-I
option.
Use angle brackets for standard header files, like
stdio.h
, and double quotes for files
that are part of your application.
Note: Both
\
and
/
can be used as directory delimiters.
To set the equivalent option in IAR Embedded Workbench, select
Project>Options>C/C++ Compiler>Preprocessor.
Project>Options>C/C++ Compiler>Preprocessor.
--initializers_in_flash
--initializers_in_flash
Use this option to place aggregate initializers in flash memory. These initializers are
otherwise placed either in the external segments
otherwise placed either in the external segments
_C
or in the initialized data segments if
the compiler option
-y
was also specified.
For example:
void foo ()
{
char buf[4] = { '1', 'd', 'g', 't' };
...
}
In other words: An aggregate initializer—an array or a struct—is constant data that is
copied to the stack dynamically at runtime, in this case every time a function is entered.
copied to the stack dynamically at runtime, in this case every time a function is entered.
The drawback of placing data in flash memory is that it takes more time to copy it; the
advantage is that it does not occupy memory in the data space.
advantage is that it does not occupy memory in the data space.
Local variables with aggregate initializers are copied from the segments:
See -y, page 200, and the chapter Initialization of local aggregates at function
invocation, page 40 for additional information.
invocation, page 40 for additional information.
This option is related to the Code options in the C/C++ Compiler category in IAR
Embedded Workbench.
Embedded Workbench.
Data
Default
-y
--initializers_in_flash
auto aggregates
NEAR_C
NEAR_F
NEAR_F
Table 46: Accessing variables with aggregate initializers