Download CodeVisionAVR User Manual - Sigma
Transcript
CodeVisionAVR There are the following predefined macros: __CODEVISIONAVR__ the version and revision of the compiler represented as an integer, example for V2.04.0 this will be 2040 __STDC__ equals to 1 __LINE__ the current line number of the compiled file __FILE__ the current compiled file __TIME__ the current time in hh:mm:ss format __UNIX_TIME__ unsigned long that represents the number of seconds elapsed since midnight UTC of 1 January 1970, not counting leap seconds __DATE__ the current date in mmm dd yyyy format __BUILD__ the build number _CHIP_ATXXXXX_ where ATXXXXX is the chip type, in uppercase letters, specified in the Project|Configure|C Compiler|Code Generation|Chip option _MCU_CLOCK_FREQUENCY_ the AVR clock frequency specified in the Project|Configure|C Compiler|Code Generation|Clock option, expressed as an unsigned long integer in Hz _MODEL_TINY_ if the program is compiled using the TINY memory model _MODEL_SMALL_ if the program is compiled using the SMALL memory model _MODEL_MEDIUM_ if the program is compiled using the MEDIUM memory model _MODEL_LARGE_ if the program is compiled using the LARGE memory model _OPTIMIZE_SIZE_ if the program is compiled with optimization for size (Project|Configure|C Compiler|Code Generation|Optimize for: Size option or #pragma optsize+) _OPTIMIZE_SPEED_ if the program is compiled with optimization for speed (Project|Configure|C Compiler|Code Generation|Optimize for: Speed option or #pragma optsize) _WARNINGS_ON_ if the warnings are enabled by the Project|Configure|C Compiler|Messages|Enable Warnings option or #pragma warn+ _WARNINGS_OFF_ if the warnings are disabled by the Project|Configure|C Compiler|Messages|Enable Warnings option or #pragma warn_PROMOTE_CHAR_TO_INT_ON_ if the automatic ANSI char to int type promotion is enabled by the Project|Configure|C Compiler|Code Generation|Promote char to int option or #pragma promotechar+ _PROMOTE_CHAR_TO_INT_OFF_ if the automatic ANSI char to int type promotion is disabled by the Project|Configure|C Compiler|Code Generation|Promote char to int option or #pragma promotechar_AVR8L_CORE_ signals that the program is compiled using the reduced core instruction set, used in chips like ATtiny10. No ADIW, SBIW, LDD and STD instructions are generated in this case. _ENHANCED_CORE_ if the program is compiled using the enhanced core instructions available in the new ATmega chips _IO_BITS_DEFINITIONS_ if the Project|Configure|C Compiler|Code Generation|Preprocessor|Include I/O Registers Bits Definitions option is enbaled _HEAP_START_ the heap starting address _HEAP_SIZE_ the heap size specified in the Project|Configure|C Compiler|Code Generation|Heap size option _UNSIGNED_CHAR_ if the Project|Configure|C Compiler|Code Generation|char is unsigned compiler option is enabled or #pragma uchar+ is used _8BIT_ENUMS_ if the Project|Configure|C Compiler|Code Generation|8 bit enums compiler option is enabled or #pragma 8bit_enums+ is used _ATXMEGA_USART_ specifies which ATxmega chip USART is used by the getchar and putchar Standard C Input/Output Functions _ATXMEGA_SPI_ specifies which ATxmega chip SPI controller is used by the SPI Functions _ATXMEGA_SPI_PORT_ specifies which ATxmega chip I/O port is used by the SPI controller. The #line directive can be used to modify the predefined __LINE__ and __FILE__ macros. The syntax is: #line integer_constant ["file_name"] © 1998-2009 HP InfoTech S.R.L. Page 86