443d3ff5e48d203425460dd2e8078583e13438cc
2 * Project: AVR USB driver
3 * Author: Christian Starkjohann
4 * Creation Date: 2006-03-01
6 * Copyright: (c) 2006 by OBJECTIVE DEVELOPMENT Software GmbH
7 * License: Proprietary, free under certain conditions. See Documentation.
8 * This Revision: $Id: iarcompat.h 174 2006-03-23 10:09:01Z cs $
13 This header is included when we compile with the IAR C-compiler and assembler.
14 It defines macros for cross compatibility between gcc and IAR-cc.
16 Thanks to Oleg Semyonov for his help with the IAR tools port!
19 #ifndef __iarcompat_h_INCLUDED__
20 #define __iarcompat_h_INCLUDED__
22 #if defined __IAR_SYSTEMS_ICC__ || defined __IAR_SYSTEMS_ASM__
24 /* Enable bit definitions */
25 #ifndef ENABLE_BIT_DEFINITIONS
26 # define ENABLE_BIT_DEFINITIONS 1
29 /* Include IAR headers */
31 #ifndef __IAR_SYSTEMS_ASM__
35 #define __attribute__(arg)
36 #define IAR_SECTION(section) @ section
38 #ifndef USB_BUFFER_SECTION
39 # define USB_BUFFER_SECTION "TINY_Z" /* if user has not selected a named section */
42 #ifdef __IAR_SYSTEMS_ASM__
43 # define __ASSEMBLER__
47 # define PROGMEM __farflash
49 # define PROGMEM __flash
52 #define PRG_RDB(addr) (*(PROGMEM char *)(addr))
54 /* The following definitions are not needed by the driver, but may be of some
55 * help if you port a gcc based project to IAR.
57 #define cli() __disable_interrupt()
58 #define sei() __enable_interrupt()
59 #define wdt_reset() __watchdog_reset()
61 /* Depending on the device you use, you may get problems with the way usbdrv.h
62 * handles the differences between devices. Since IAR does not use #defines
63 * for MCU registers, we can't check for the existence of a particular
64 * register with an #ifdef. If the autodetection mechanism fails, include
65 * definitions for the required USB_INTR_* macros in your usbconfig.h. See
66 * usbconfig-prototype.h and usbdrv.h for details.
69 #endif /* defined __IAR_SYSTEMS_ICC__ || defined __IAR_SYSTEMS_ASM__ */
70 #endif /* __iarcompat_h_INCLUDED__ */