Datasheet

PREDEFINED GLOBALS AND CONSTANTS
To facilitate programming of AVR compliant MCUs, the mikroC PRO for AVR imple-
ments a number of predefined globals and constants.
All AVR SFR registers and their bits are implicitly declared as global variables.
These identifiers have an external linkage, and are visible in the entire project.
When creating a project, the mikroC PRO for AVR will include an appropriate (*) file
from defs folder, containing declarations of available SFR registers and constants.
For a complete set of predefined globals and constants, look for “Defs” in the mikroC
PRO for AVR installation folder, or probe the Code Assistant for specific letters
(Ctrl+Space in the Code Editor).
Predefined project level defines
There are 2 predefined project level defines for any project you make. These defines
are based on values that you have entered/edited in the current project:
- First one is equal to the name of selected device for the project i.e. if
ATmega16 is selected device, then ATmega16 token will be defined as 1,
so it can be used for conditional compilation.
#ifdef ATmega16
...
#endif
- The second one is __FOSC__ value of frequency (in Khz) for which the
project is built
- Third one is for identifying mikroC PRO for AVR compiler:
#ifdef __MIKROC_PRO_FOR_AVR__
...
#endif
- Fourth one is for identifying the build version. For instance, if a desired
build version is 142, user should put this in his code:
#if __MIKROC_PRO_FOR_AVR_BUILD__= 142
...
#endif
User can define custom project level defines.
99
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Specifics
mikroC PRO for AVR
CHAPTER 3