aboutsummaryrefslogtreecommitdiffstats
path: root/usbdrv/iarcompat.h
diff options
context:
space:
mode:
authorChristian Starkjohann <cs+github@obdev.at>2008-04-17 19:28:18 +0000
committerChristian Starkjohann <cs+github@obdev.at>2008-04-17 19:28:18 +0000
commit1c8a62d484550aba8db26ffb7202daa3d3a76396 (patch)
tree0dfde649d9e2b96bb4c029548082dac861fe13c1 /usbdrv/iarcompat.h
parentc45ef28d96f1eed5c5d06dd42b937c0b751d9a72 (diff)
downloadv-usb-1c8a62d484550aba8db26ffb7202daa3d3a76396.tar.gz
v-usb-1c8a62d484550aba8db26ffb7202daa3d3a76396.tar.bz2
v-usb-1c8a62d484550aba8db26ffb7202daa3d3a76396.zip
- used wrong name in copy -- fixed this
Diffstat (limited to 'usbdrv/iarcompat.h')
-rw-r--r--usbdrv/iarcompat.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/usbdrv/iarcompat.h b/usbdrv/iarcompat.h
new file mode 100644
index 0000000..418a485
--- /dev/null
+++ b/usbdrv/iarcompat.h
@@ -0,0 +1,65 @@
+/* Name: iarcompat.h
+ * Project: AVR USB driver
+ * Author: Christian Starkjohann
+ * Creation Date: 2006-03-01
+ * Tabsize: 4
+ * Copyright: (c) 2006 by OBJECTIVE DEVELOPMENT Software GmbH
+ * License: GNU GPL v2 (see License.txt) or proprietary (CommercialLicense.txt)
+ * This Revision: $Id$
+ */
+
+/*
+General Description:
+This header is included when we compile with the IAR C-compiler and assembler.
+It defines macros for cross compatibility between gcc and IAR-cc.
+
+Thanks to Oleg Semyonov for his help with the IAR tools port!
+*/
+
+#ifndef __iarcompat_h_INCLUDED__
+#define __iarcompat_h_INCLUDED__
+
+#if defined __IAR_SYSTEMS_ICC__ || defined __IAR_SYSTEMS_ASM__
+
+/* Enable bit definitions */
+#ifndef ENABLE_BIT_DEFINITIONS
+# define ENABLE_BIT_DEFINITIONS 1
+#endif
+
+/* Include IAR headers */
+#include <ioavr.h>
+#ifndef __IAR_SYSTEMS_ASM__
+# include <inavr.h>
+#endif
+
+#define __attribute__(arg)
+
+#ifdef __IAR_SYSTEMS_ASM__
+# define __ASSEMBLER__
+#endif
+
+#ifdef __HAS_ELPM__
+# define PROGMEM __farflash
+#else
+# define PROGMEM __flash
+#endif
+
+#define PRG_RDB(addr) (*(PROGMEM char *)(addr))
+
+/* The following definitions are not needed by the driver, but may be of some
+ * help if you port a gcc based project to IAR.
+ */
+#define cli() __disable_interrupt()
+#define sei() __enable_interrupt()
+#define wdt_reset() __watchdog_reset()
+
+/* Depending on the device you use, you may get problems with the way usbdrv.h
+ * handles the differences between devices. Since IAR does not use #defines
+ * for MCU registers, we can't check for the existence of a particular
+ * register with an #ifdef. If the autodetection mechanism fails, include
+ * definitions for the required USB_INTR_* macros in your usbconfig.h. See
+ * usbconfig-prototype.h and usbdrv.h for details.
+ */
+
+#endif /* defined __IAR_SYSTEMS_ICC__ || defined __IAR_SYSTEMS_ASM__ */
+#endif /* __iarcompat_h_INCLUDED__ */