00001
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
00077
00078
00079
00080
00081
00082
00083
00084
00085
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
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