Ei kuvausta
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

iarcompat.h 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* Name: iarcompat.h
  2. * Project: AVR USB driver
  3. * Author: Christian Starkjohann
  4. * Creation Date: 2006-03-01
  5. * Tabsize: 4
  6. * Copyright: (c) 2006 by OBJECTIVE DEVELOPMENT Software GmbH
  7. * License: GNU GPL v2 (see License.txt) or proprietary (CommercialLicense.txt)
  8. * This Revision: $Id: iarcompat.h 533 2008-02-28 15:35:25Z cs $
  9. */
  10. /*
  11. General Description:
  12. This header is included when we compile with the IAR C-compiler and assembler.
  13. It defines macros for cross compatibility between gcc and IAR-cc.
  14. Thanks to Oleg Semyonov for his help with the IAR tools port!
  15. */
  16. #ifndef __iarcompat_h_INCLUDED__
  17. #define __iarcompat_h_INCLUDED__
  18. #if defined __IAR_SYSTEMS_ICC__ || defined __IAR_SYSTEMS_ASM__
  19. /* Enable bit definitions */
  20. #ifndef ENABLE_BIT_DEFINITIONS
  21. # define ENABLE_BIT_DEFINITIONS 1
  22. #endif
  23. /* Include IAR headers */
  24. #include <ioavr.h>
  25. #ifndef __IAR_SYSTEMS_ASM__
  26. # include <inavr.h>
  27. #endif
  28. #define __attribute__(arg)
  29. #ifdef __IAR_SYSTEMS_ASM__
  30. # define __ASSEMBLER__
  31. #endif
  32. #ifdef __HAS_ELPM__
  33. # define PROGMEM __farflash
  34. #else
  35. # define PROGMEM __flash
  36. #endif
  37. #define PRG_RDB(addr) (*(PROGMEM char *)(addr))
  38. /* The following definitions are not needed by the driver, but may be of some
  39. * help if you port a gcc based project to IAR.
  40. */
  41. #define cli() __disable_interrupt()
  42. #define sei() __enable_interrupt()
  43. #define wdt_reset() __watchdog_reset()
  44. /* Depending on the device you use, you may get problems with the way usbdrv.h
  45. * handles the differences between devices. Since IAR does not use #defines
  46. * for MCU registers, we can't check for the existence of a particular
  47. * register with an #ifdef. If the autodetection mechanism fails, include
  48. * definitions for the required USB_INTR_* macros in your usbconfig.h. See
  49. * usbconfig-prototype.h and usbdrv.h for details.
  50. */
  51. #endif /* defined __IAR_SYSTEMS_ICC__ || defined __IAR_SYSTEMS_ASM__ */
  52. #endif /* __iarcompat_h_INCLUDED__ */