AVR Z-LINKŪ


compiler_avr.h

Go to the documentation of this file.
00001 /* This file has been prepared for Doxygen automatic documentation generation.*/
00050 #ifndef COMPILER_AVR_H
00051 #define COMPILER_AVR_H
00052 
00054 #define AVR_ENTER_CRITICAL_REGION( ) uint8_t volatile saved_sreg = SREG; cli( );
00055 
00058 #define AVR_LEAVE_CRITICAL_REGION( ) SREG = saved_sreg;
00059 
00060 #if defined( __ICCAVR__ )
00061 
00062 #include <inavr.h>
00063 #include <ioavr.h>
00064 #include "crc16.h"
00065 
00077 #define delay_us( us )   ( __delay_cycles( ( F_CPU / 1000000UL ) * ( us ) ) )
00078 
00079 /*
00080  * Some preprocessor magic to allow for a header file abstraction of
00081  * interrupt service routine declarations for the IAR compiler.  This
00082  * requires the use of the C99 _Pragma() directive (rather than the
00083  * old #pragma one that could not be used as a macro replacement), as
00084  * well as two different levels of preprocessor concetanations in
00085  * order to do both, assign the correct interrupt vector name, as well
00086  * as construct a unique function name for the ISR.
00087  *
00088  * Do *NOT* try to reorder the macros below, or you'll suddenly find
00089  * out about all kinds of IAR bugs...
00090  */
00091 #define PRAGMA(x) _Pragma( #x )
00092 #define ISR(vec) PRAGMA( vector=vec ) __interrupt void handler_##vec(void)
00093 #define sei( ) (__enable_interrupt( ))
00094 #define cli( ) (__disable_interrupt( ))
00095 
00096 #define INLINE PRAGMA( inline=forced ) static
00097 
00098 #elif defined( __GNUC__ )
00099 
00100 #include <avr/io.h>
00101 #include <avr/interrupt.h>
00102 
00103 #include <util/crc16.h>
00104 #include <util/delay.h>
00105 
00106 #define delay_us( us )   (_delay_us( us ))
00107 
00108 #define INLINE static inline
00109 #define crc_ccitt_update( crc, data ) _crc_ccitt_update( crc, data )
00110 
00111 #define __z 
00112 #else
00113 #error Compiler not supported.
00114 #endif
00115 #endif
@DOC_TITLE@
Generated on Wed Jul 11 18:16:31 2007 for AVR2001 AT86RF230 Software Programmer's Manual by doxygen 1.4.7