AVR Z-LINKŪ


compiler_avr32.h

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