]> cloudbase.mooo.com Git - irmp.git/blobdiff - irmpsystem.h
Version 2.6.9: corrected some minor definition errors
[irmp.git] / irmpsystem.h
index b73d81f9918f3ac56554ab3caeaad08c2e5d322a..2c31a72175e1aa16273e3f62048bad4e152d6ea9 100644 (file)
@@ -1,9 +1,9 @@
 /*---------------------------------------------------------------------------------------------------------------------------------------------------\r
  * irmpsystem.h - system specific includes and defines\r
  *\r
- * Copyright (c) 2009-2012 Frank Meyer - frank(at)fli4l.de\r
+ * Copyright (c) 2009-2014 Frank Meyer - frank(at)fli4l.de\r
  *\r
- * $Id: irmpsystem.h,v 1.7 2012/11/18 17:51:26 fm Exp $\r
+ * $Id: irmpsystem.h,v 1.15 2015/01/19 10:54:37 fm Exp $\r
  *\r
  * This program is free software; you can redistribute it and/or modify\r
  * it under the terms of the GNU General Public License as published by\r
@@ -21,6 +21,9 @@
 \r
 #if defined(__18CXX)                                                                // Microchip PIC C18 compiler\r
 #  define PIC_C18\r
+#elif defined(__XC8)                                                                // PIC XC8 compiler\r
+#  include <xc.h>\r
+#  define PIC_C18\r
 #elif defined(__PCM__) || defined(__PCB__) || defined(__PCH__)                      // CCS PIC compiler\r
 #  define PIC_CCS\r
 #elif defined(STM32L1XX_MD) || defined(STM32L1XX_MDP) || defined(STM32L1XX_HD)      // ARM STM32\r
 #  include <stm32f10x.h>\r
 #  define ARM_STM32\r
 #  define ARM_STM32F10X\r
+#  define F_CPU (SysCtlClockGet())\r
 #elif defined(STM32F4XX)                                                            // ARM STM32\r
 #  include <stm32f4xx.h>\r
 #  define ARM_STM32\r
 #  define ARM_STM32F4XX\r
-#elif defined(TARGET_IS_BLIZZARD_RA2)                                                                                           // TI Stellaris (tested on Stellaris Launchpad with Code Composer Studio)\r
+#elif defined(TARGET_IS_BLIZZARD_RA2)                                               // TI Stellaris (tested on Stellaris Launchpad with Code Composer Studio)\r
 #  define STELLARIS_ARM_CORTEX_M4\r
 #  define F_CPU (SysCtlClockGet())\r
-#elif defined(unix) || defined(WIN32)                                               // Unix/Linux or Windows\r
+#elif defined(unix) || defined(WIN32) || defined(__APPLE__)                         // Unix/Linux or Windows or Apple\r
 #  define UNIX_OR_WINDOWS\r
 #else\r
 #  define ATMEL_AVR                                                                 // ATMEL AVR\r
@@ -54,7 +58,6 @@
 #  include <stdlib.h>\r
 #  define F_CPU 8000000L\r
 #  define ANALYZE\r
-#  define DEBUG\r
 #  ifdef unix\r
 #    include <stdint.h>\r
 #  else\r
@@ -93,6 +96,13 @@ typedef unsigned short                  uint16_t;
 #  define PROGMEM volatile\r
 #  define memcpy_P memcpy\r
 #  define APP_SYSTICKS_PER_SEC          32\r
+#elif defined(ARM_STM32F10X)\r
+#  include "stm32f10x_gpio.h"\r
+#  include "stm32f10x_rcc.h"\r
+#  include "stm32f10x_tim.h"\r
+#  include "misc.h"\r
+#  define PROGMEM\r
+#  define memcpy_P                      memcpy\r
 #else\r
 #  define PROGMEM\r
 #  define memcpy_P                      memcpy\r
@@ -103,10 +113,12 @@ typedef unsigned char                   uint8_t;
 typedef unsigned short                  uint16_t;\r
 #endif\r
 \r
-#if defined (PIC_C18)\r
+#if defined (PIC_C18)                                                               // PIC C18 or XC8 compiler\r
 #  include <p18cxxx.h>                                                              // main PIC18 h file\r
+#ifndef __XC8\r
 #  include <timers.h>                                                               // timer lib\r
 #  include <pwm.h>                                                                  // pwm lib\r
+#endif\r
 #  define IRSND_PIC_CCP1                1                                           // PIC C18 RC2 = PWM1 module\r
 #  define IRSND_PIC_CCP2                2                                           // PIC C18 RC1 = PWM2 module\r
 #endif\r
@@ -116,9 +128,9 @@ typedef unsigned short                  uint16_t;
 #  define FALSE                         0\r
 #endif\r
 \r
-typedef struct\r
+typedef struct __attribute__ ((__packed__))\r
 {\r
-  uint8_t                               protocol;                                   // protocol, i.e. NEC_PROTOCOL\r
+  uint8_t                               protocol;                                   // protocol, e.g. NEC_PROTOCOL\r
   uint16_t                              address;                                    // address\r
   uint16_t                              command;                                    // command\r
   uint8_t                               flags;                                      // flags, e.g. repetition\r