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