X-Git-Url: http://cloudbase.mooo.com/gitweb/irmp.git/blobdiff_plain/c495747931de995844cc21ae5ba0feb1b1047a5e..30d1689ddd3c91f22ee9f79ae4cd6c897b7badbb:/irmpsystem.h diff --git a/irmpsystem.h b/irmpsystem.h index 41cd344..25bacb2 100644 --- a/irmpsystem.h +++ b/irmpsystem.h @@ -1,9 +1,9 @@ /*--------------------------------------------------------------------------------------------------------------------------------------------------- * irmpsystem.h - system specific includes and defines * - * Copyright (c) 2009-2015 Frank Meyer - frank(at)fli4l.de + * Copyright (c) 2009-2016 Frank Meyer - frank(at)fli4l.de * - * $Id: irmpsystem.h,v 1.18 2015/05/18 10:51:07 fm Exp $ + * $Id: irmpsystem.h,v 1.25 2016/12/19 09:01:41 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 @@ -43,11 +43,28 @@ # include # define ARM_STM32 # define ARM_STM32F4XX +#elif defined(__SDCC_stm8) // STM8 +# define SDCC_STM8 #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(__xtensa__) // ESP8266 (Arduino) +# include "Arduino.h" +# include "ets_sys.h" +# include "osapi.h" +# include "gpio.h" +# include "os_type.h" +# include "c_types.h" +# define uint_fast8_t uint8_t +# define uint_fast16_t uint16_t +#elif defined(TEENSYDUINO) && (defined(__MK20DX256__) || defined(__MK20DX128__)) // Teensy 3.x (tested on Teensy 3.1 in Arduino 1.6.5 / Teensyduino 1.2.5) +# include +# define TEENSY_ARM_CORTEX_M4 #elif defined(unix) || defined(WIN32) || defined(__APPLE__) // Unix/Linux or Windows or Apple # define UNIX_OR_WINDOWS +#elif defined(__MBED__) // mbed platform +// #include "mbed.h" // if mbed.h is used, source must be compiled as cpp +#include "gpio_api.h" #else # define ATMEL_AVR // ATMEL AVR #endif @@ -116,8 +133,28 @@ typedef unsigned short uint16_t; # define PROGMEM # define memcpy_P memcpy -#else +#elif defined(SDCC_STM8) +# include "stm8s.h" +# define PROGMEM +# define memcpy_P memcpy +# define __attribute__(x) +# define uint_fast8_t uint8_t +# define uint_fast16_t uint16_t + +#elif defined(TEENSY_ARM_CORTEX_M4) +# define PROGMEM +# define memcpy_P memcpy + +#elif defined(__xtensa__) +# define PROGMEM +# define memcpy_P memcpy + +#elif defined(__MBED__) +# define PROGMEM +# define memcpy_P memcpy + +#else # define PROGMEM # define memcpy_P memcpy @@ -126,6 +163,8 @@ typedef unsigned short uint16_t; #if defined(PIC_CCS) || defined(PIC_C18) || defined(ARM_STM32) || defined(STELLARIS_ARM_CORTEX_M4) typedef unsigned char uint8_t; typedef unsigned short uint16_t; +typedef unsigned char uint_fast8_t; +typedef unsigned short uint_fast16_t; #endif #if defined (PIC_C18) // PIC C18 or XC8 compiler @@ -143,12 +182,18 @@ typedef unsigned short uint16_t; # define FALSE 0 #endif -typedef struct __attribute__ ((__packed__)) +#if defined(PIC_C18) +#define IRMP_PACKED_STRUCT +#else +#define IRMP_PACKED_STRUCT __attribute__ ((__packed__)) +#endif + +typedef struct IRMP_PACKED_STRUCT { - uint8_t protocol; // protocol, e.g. NEC_PROTOCOL - uint16_t address; // address - uint16_t command; // command - uint8_t flags; // flags, e.g. repetition + uint8_t protocol; // protocol, e.g. NEC_PROTOCOL + uint16_t address; // address + uint16_t command; // command + uint8_t flags; // flags, e.g. repetition } IRMP_DATA; #endif // _IRMPSYSTEM_H_