summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorukw2017-02-17 09:16:59 +0000
committerukw2017-02-17 09:16:59 +0000
commit30d1689ddd3c91f22ee9f79ae4cd6c897b7badbb (patch)
tree535738adcad429029f4b413ba7efc3fe15c6ed34
parenta777fd4e74625adc63777d9dae68c5006b70b0ab (diff)
downloadirmp-master.zip
Version 3.0.7 - added SAMSUNGAH protocol, improved some code for ESP8266master
git-svn-id: svn://mikrocontroller.net/irmp@181 aeb2e35e-bfc4-4214-b83c-9e8de998ed28
-rw-r--r--README.txt4
-rw-r--r--irmp-main-esp8266.c49
-rw-r--r--irmp-main-pic-12F1840.c72
-rw-r--r--irmp-main-stm32.c4
-rw-r--r--irmp.c81
-rw-r--r--irmpconfig.h5
-rw-r--r--irmpextlog.c6
-rw-r--r--irmpprotocols.h26
-rw-r--r--irmpsystem.h11
-rw-r--r--irsnd.c99
-rw-r--r--irsnd.h16
-rw-r--r--irsndconfig.h15
12 files changed, 253 insertions, 135 deletions
diff --git a/README.txt b/README.txt
index 495e491..03c0a5f 100644
--- a/README.txt
+++ b/README.txt
@@ -1,8 +1,8 @@
IRMP - Infrared Multi Protocol Decoder
--------------------------------------
-Version IRMP: 3.0.5 2016-12-16
-Version IRSND: 3.0.5 2016-11-18
+Version IRMP: 3.0.7 2017-02-17
+Version IRSND: 3.0.6 2016-12-19
Documentation:
diff --git a/irmp-main-esp8266.c b/irmp-main-esp8266.c
index caa28e4..b8c6445 100644
--- a/irmp-main-esp8266.c
+++ b/irmp-main-esp8266.c
@@ -2,7 +2,7 @@
Test program IRMP for ESP8266 2015-11-16 Wolfgang Strobl, Bonn
-$Id: irmp-main-esp8266.c,v 1.2 2016/01/12 21:15:16 fm Exp $
+$Id: irmp-main-esp8266.c,v 1.4 2017/02/17 09:13:06 fm Exp $
IRMP ported to ESP8266, testet with MOD-WIFI-ESP8266-DEV on
ESP8266-EVB evaluation board. https://www.olimex.com/Products/IoT/ESP8266-EVB/
@@ -10,7 +10,7 @@ ESP8266-EVB evaluation board. https://www.olimex.com/Products/IoT/ESP8266-EVB/
Connections
-----------
-Input TSOP via 1k resistor at GPIO12 (Pin 7 UEXT),
+Input TSOP via 1k resistor at GPIO12 (Pin 7 UEXT),
Output via UART (Pin 3/4 UEXT)
example output
@@ -106,7 +106,7 @@ static void user_procTask(os_event_t *events);
// unbuffered Uart-rx, based on a comment in
// https://github.com/SuperHouse/esp-open-rtos/issues/18
-int my_rx_one_char(void) // char or -1
+int my_rx_one_char(void) // char or -1
{
int c = READ_PERI_REG(UART_STATUS(0)) & 0xff;
if (c) return READ_PERI_REG(UART_FIFO(0));
@@ -118,11 +118,11 @@ IRMP_DATA irmp_data;
//------------------ User Task ---------------------
-static void
+static void
user_procTask(os_event_t *events)
{
- int rc = irmp_get_data (&irmp_data);
-
+ int rc = irmp_get_data (&irmp_data);
+
if (rc)
{
os_printf("\nIRMP %10s(%2d): addr=0x%04x cmd=0x%04x, f=%d ",
@@ -133,13 +133,13 @@ user_procTask(os_event_t *events)
irmp_data.flags
);
}
-
+
// https://github.com/SuperHouse/esp-open-rtos/issues/18
// uart_rx_one_char ist offenbar eine ROM-Funktion.
-
+
int c = my_rx_one_char();
-
- if(c != -1)
+
+ if(c != -1)
{
uart_tx_one_char(0,c);
os_printf("(0x%02x, %d) ",c,c);
@@ -151,43 +151,42 @@ user_procTask(os_event_t *events)
os_printf("gpio=%08x ",gpio_input_get());
break;
}
- }
+ }
os_delay_us(100);
- system_os_post(user_procTaskPrio, 0, 0 );
+ system_os_post(user_procTaskPrio, 0, 0 );
}
-// Init function
+// Init function
void ICACHE_FLASH_ATTR
user_init()
{
void* p;
uint32 now,diff;
-
+
//~ system_timer_reinit(); //US_TIMER
-
- uart_init(BIT_RATE_115200, BIT_RATE_115200);
+
+ uart_init(BIT_RATE_115200, BIT_RATE_115200);
os_printf("\n\nESP8266 IRMP Test v0.3 W.Strobl 20151120\n");
os_printf("F_INTERRUPTS==%d\n",F_INTERRUPTS);
-
+
sysinfo();
-
+
hw_timer_init(NMI_SOURCE,1);
hw_timer_set_func(irmp_timer);
hw_timer_arm (1000000/F_INTERRUPTS);
-
+
// Initialize the GPIO subsystem.
gpio_init();
-
-
+
+
irmp_init ();
-
+
//Start os task
-
+
system_os_task(user_procTask, user_procTaskPrio,user_procTaskQueue, user_procTaskQueueLen);
system_os_post(user_procTaskPrio, 0, 0 );
-
+
os_printf("IRMP listening ...\n");
-
}
diff --git a/irmp-main-pic-12F1840.c b/irmp-main-pic-12F1840.c
index 821e9e5..3ade38d 100644
--- a/irmp-main-pic-12F1840.c
+++ b/irmp-main-pic-12F1840.c
@@ -1,11 +1,11 @@
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* irmp-main-pic-12F1840.c - example main module for PIC 12f1840
- *
+ *
* IR decoder using IRMP
*
* (c) 2014 Wolfgang Strobl (news4 at mystrobl.de) 2014-03-12:2014-07-20
*
- * $Id: irmp-main-pic-12F1840.c,v 1.4 2016/09/09 08:01:11 fm Exp $
+ * $Id: irmp-main-pic-12F1840.c,v 1.6 2017/02/17 09:13:06 fm Exp $
*
* This demo module is runnable on a Microchip PIC 12F1840
*
@@ -18,11 +18,11 @@
* (at your option) any later version.
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
-
-
-/*
-Hauptprogramm fuer den nachfolgenden Testaufbau, bestehend aus zwei mal
+
+/*
+
+Hauptprogramm fuer den nachfolgenden Testaufbau, bestehend aus zwei mal
TSOP1736+ PIC12F1840
@@ -32,12 +32,12 @@ Hauptprogramm fuer den nachfolgenden Testaufbau, bestehend aus zwei mal
RS232 out -|___|-------GP4--o| |o--GP1 / ICSPCLK ___ LED
RS232 in -|___|---Vpp/GP3--o|__|o--GP2-----------|___|- ->|---Vss
10k
-
+
auf einem Steckbrett. (Genauer gesagt, dies ist die aktuelle Beschaltung
fuer V1.8, V1.0 ist aber bzgl. IRMP-Empfang funktional identisch. Nicht eingezeichnet
ist ein Abblockkondensator von 100nF ueber Vss und Vdd.
-Uebersetzt mit Microchip MPLAB XC8 C Compiler (Free Mode) V1.31
+Uebersetzt mit Microchip MPLAB XC8 C Compiler (Free Mode) V1.31
im stark gecrippelten "Free Mode".
Memory Summary: (V 1.8)
@@ -49,13 +49,13 @@ Memory Summary: (V 1.8)
ID Location space used 0h ( 0) of 4h bytes ( 0.0%)
-Testaufbau:
+Testaufbau:
Zwei Steckbretter,
-urspruengliche Version des Programms als Empfaenger,
+urspruengliche Version des Programms als Empfaenger,
aktuelle Version als Sender, Aufzeichnung mit putty,
angeschlossen jeweils per USB2RS232-Kabel von Conrad
-(972543, basierend auf Prolific PL2303). Soft-UART
+(972543, basierend auf Prolific PL2303). Soft-UART
fuer Input, da 12F1820 keine Kontrolle ueber Input-
Polaritaet erlaubt und ich fuer Testaufbauten eine
Minimalbeschaltung bevorzuge.
@@ -64,8 +64,8 @@ Kurze Distanz
(~30 cm) zwischen Sender und Empfaenger), keine genaue Ausrichtung.
Stromversorgung wahlwweise mit 5V via PICkit 2 oder 3x1.2V NiMH-AA.
-Zunaechst
-CD TAPE TUNER AUX OFF mit Philips FB,
+Zunaechst
+CD TAPE TUNER AUX OFF mit Philips FB,
OFF mit VAOVA TV-2900HDD FB
dann Eingabe . und n beim Sender.
@@ -125,7 +125,7 @@ void InitApp(void)
IRCF1=1;
IRCF2=1;
IRCF3=1;
- SPLLEN=1; // p 46 and 54
+ SPLLEN=1; // p 46 and 54
}
/******************************************************************************/
@@ -155,8 +155,8 @@ void InitApp(void)
// UART
/******************************************************************************/
-#define GPIO3 RA3
-#define GPIO4 RA4
+#define GPIO3 RA3
+#define GPIO4 RA4
#define SOFTUART_RXPIN GPIO3
#define SOFTUART_STDIO 1
@@ -170,12 +170,12 @@ void InitApp(void)
#define kbhit softuartkbhit
-void
+void
RS232init(void)
{
// Transmit
TXCKSEL = 1; // put TX on pin 4 - not 0 -, p 102
- SPBRGL = (_XTAL_FREQ/BAUD/64-1);
+ SPBRGL = (_XTAL_FREQ/BAUD/64-1);
SPBRGH = 0;
BRGH = 0;
BRG16 = 0;
@@ -187,24 +187,24 @@ RS232init(void)
}
// EUSART transmit
- void
+ void
putch(char c)
{
while (!TRMT) _delay(1);
TXREG=c;
}
-
+
/******************************************************************************/
// Timer and ISR
/******************************************************************************/
-
-void
+
+void
timer1_init(void)
{
// p 154
TMR1=0xFC00; // p. 155 wait 1024 cycles for stabilization.
TMR1CS1=0; // Clock source == System Clock
- TMR1CS0=1;
+ TMR1CS0=1;
TMR1IE=1; // enable TMR1 interrupts
PEIE=1; // enable Pheripheral Interrupts
TMR1IF=0;
@@ -218,9 +218,9 @@ timer1_init(void)
void interrupt isr(void)
{
- TMR1=0xffff-_XTAL_FREQ/F_INTERRUPTS;
+ TMR1=0xffff-_XTAL_FREQ/F_INTERRUPTS;
TMR1IF=0; // clear timer 1 interrupt
-
+
if (!irsnd_ISR())
{
irmp_ISR();
@@ -232,20 +232,20 @@ IRMP_DATA irmp_data;
void RC5(uint16_t addr,uint16_t cmd, uint8_t repetitions)
{
- irmp_data.protocol = IRMP_RC5_PROTOCOL;
+ irmp_data.protocol = IRMP_RC5_PROTOCOL;
irmp_data.address = addr;
irmp_data.command = cmd;
irmp_data.flags = repetitions;
- irsnd_send_data (&irmp_data, FALSE);
+ irsnd_send_data (&irmp_data, FALSE);
}
void NEC(int addr,int cmd)
{
- irmp_data.protocol = IRMP_NEC_PROTOCOL;
+ irmp_data.protocol = IRMP_NEC_PROTOCOL;
irmp_data.address = addr;
irmp_data.command = cmd;
irmp_data.flags = 0;
- irsnd_send_data (&irmp_data, FALSE);
+ irsnd_send_data (&irmp_data, FALSE);
}
@@ -258,18 +258,18 @@ main (void)
{
IRMP_DATA irmp_data;
char c;
- InitApp();
+ InitApp();
PWMoff();
RS232init();
-
+
__delay_ms(200);
printf("IRMP PIC 12F1840 1.8 ws\r\n");
irmp_init(); // initialize irmp
timer1_init(); // initialize timer1
ei(); // enable interrupts
TMR1ON=1; // start timer
-
+
for (;;)
{
if (kbhit())
@@ -285,7 +285,7 @@ main (void)
else if (c=='n')
{
printf("NEC ");
- NEC(0x55,0xaa);
+ NEC(0x55,0xaa);
}
else
{
@@ -299,11 +299,11 @@ main (void)
if (irmp_get_data (&irmp_data))
{
printf("P ");
- printf("%d a=0x%04x c=0x%04x f=0x%02x (",irmp_data.protocol, irmp_data.address,irmp_data.command,irmp_data.flags);
-
+ printf("%d a=0x%04x c=0x%04x f=0x%02x (",irmp_data.protocol, irmp_data.address,irmp_data.command,irmp_data.flags);
+
#if IRMP_PROTOCOL_NAMES
printf(irmp_protocol_names[irmp_data.protocol]);
-#else
+#else
switch(irmp_data.protocol)
{
case 1:
diff --git a/irmp-main-stm32.c b/irmp-main-stm32.c
index 671b117..d97bb3e 100644
--- a/irmp-main-stm32.c
+++ b/irmp-main-stm32.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2009-2016 Frank Meyer - frank(at)fli4l.de
*
- * $Id: irmp-main-stm32.c,v 1.2 2016/01/12 21:15:16 fm Exp $
+ * $Id: irmp-main-stm32.c,v 1.4 2017/02/17 09:13:06 fm Exp $
*
* This demo module is runnable on STM32
*
@@ -64,7 +64,7 @@ int
main (void)
{
IRMP_DATA irmp_data;
-
+
irmp_init(); // initialize irmp
timer2_init(); // initialize timer2
diff --git a/irmp.c b/irmp.c
index 27c31be..150d69f 100644
--- a/irmp.c
+++ b/irmp.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2009-2016 Frank Meyer - frank(at)fli4l.de
*
- * $Id: irmp.c,v 1.190 2016/12/16 09:18:11 fm Exp $
+ * $Id: irmp.c,v 1.192 2017/02/17 09:13:06 fm Exp $
*
* Supported AVR mikrocontrollers:
*
@@ -140,6 +140,17 @@
#define SAMSUNG_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
#define SAMSUNG_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
+#define SAMSUNGAH_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
+#define SAMSUNGAH_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
+#define SAMSUNGAH_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
+#define SAMSUNGAH_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
+#define SAMSUNGAH_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
+#define SAMSUNGAH_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
+#define SAMSUNGAH_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
+#define SAMSUNGAH_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
+#define SAMSUNGAH_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
+#define SAMSUNGAH_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
+
#define MATSUSHITA_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
#define MATSUSHITA_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
#define MATSUSHITA_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
@@ -647,6 +658,7 @@ static const char proto_technics[] PROGMEM = "TECHNICS";
static const char proto_panasonic[] PROGMEM = "PANASONIC";
static const char proto_mitsu_heavy[] PROGMEM = "MITSU_HEAVY";
static const char proto_vincent[] PROGMEM = "VINCENT";
+static const char proto_samsungah[] PROGMEM = "SAMSUNGAH";
static const char proto_radio1[] PROGMEM = "RADIO1";
@@ -704,6 +716,7 @@ irmp_protocol_names[IRMP_N_PROTOCOLS + 1] PROGMEM =
proto_panasonic,
proto_mitsu_heavy,
proto_vincent,
+ proto_samsungah,
proto_radio1
};
@@ -863,7 +876,7 @@ irmp_uart_init (void)
// UART enable
USART_Cmd(STM32_UART_COM, ENABLE);
-
+
#elif defined(ARDUINO)
// we use the Arduino Serial Imlementation
// you have to call Serial.begin(SER_BAUD); in Arduino setup() function
@@ -932,25 +945,31 @@ irmp_uart_putc (unsigned char ch)
#else
#if (IRMP_EXT_LOGGING == 0)
-
- # if defined (__AVR_XMEGA__)
- while (!(USARTC1.STATUS & USART_DREIF_bm));
- USARTC1.DATA = ch;
-
- # else //AVR_MEGA
+
+# if defined (__AVR_XMEGA__)
+ while (!(USARTC1.STATUS & USART_DREIF_bm))
+ {
+ ;
+ }
+
+ USARTC1.DATA = ch;
+
+# else // AVR_MEGA
while (!(UART0_UCSRA & UART0_UDRE_BIT_VALUE))
{
;
}
UART0_UDR = ch;
- #endif //__AVR_XMEGA__
+
+# endif // __AVR_XMEGA__
+
#else
sendextlog(ch); // use external log
-#endif //IRMP_EXT_LOGGING
-#endif //ARM_STM32F4XX
+#endif // IRMP_EXT_LOGGING
+#endif // ARM_STM32F4XX
#else
fputc (ch, stderr);
#endif // UNIX_OR_WINDOWS
@@ -1224,6 +1243,31 @@ static const PROGMEM IRMP_PARAMETER samsung_param =
#endif
+#if IRMP_SUPPORT_SAMSUNGAH_PROTOCOL == 1
+
+static const PROGMEM IRMP_PARAMETER samsungah_param =
+{
+ IRMP_SAMSUNGAH_PROTOCOL, // protocol: ir protocol
+ SAMSUNGAH_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
+ SAMSUNGAH_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
+ SAMSUNGAH_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
+ SAMSUNGAH_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
+ SAMSUNGAH_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
+ SAMSUNGAH_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
+ SAMSUNGAH_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
+ SAMSUNGAH_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
+ SAMSUNGAH_ADDRESS_OFFSET, // address_offset: address offset
+ SAMSUNGAH_ADDRESS_OFFSET + SAMSUNGAH_ADDRESS_LEN, // address_end: end of address
+ SAMSUNGAH_COMMAND_OFFSET, // command_offset: command offset
+ SAMSUNGAH_COMMAND_OFFSET + SAMSUNGAH_COMMAND_LEN, // command_end: end of command
+ SAMSUNGAH_COMPLETE_DATA_LEN, // complete_len: complete length of frame
+ SAMSUNGAH_STOP_BIT, // stop_bit: flag: frame has stop bit
+ SAMSUNGAH_LSB, // lsb_first: flag: LSB first
+ SAMSUNGAH_FLAGS // flags: some flags
+};
+
+#endif
+
#if IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
static const PROGMEM IRMP_PARAMETER telefunken_param =
@@ -2161,6 +2205,7 @@ irmp_init (void)
pinMode(IRMP_PIN, INPUT);
#elif defined(__xtensa__) // ESP8266
+ pinMode(IRMP_BIT_NUMBER, INPUT);
// select pin function
# if (IRMP_BIT_NUMBER == 12)
PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDI_U, FUNC_GPIO12);
@@ -3060,6 +3105,20 @@ irmp_ISR (void)
else
#endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
+#if IRMP_SUPPORT_SAMSUNGAH_PROTOCOL == 1
+ if (irmp_pulse_time >= SAMSUNGAH_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= SAMSUNGAH_START_BIT_PULSE_LEN_MAX &&
+ irmp_pause_time >= SAMSUNGAH_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= SAMSUNGAH_START_BIT_PAUSE_LEN_MAX)
+ { // it's SAMSUNGAH
+#ifdef ANALYZE
+ ANALYZE_PRINTF ("protocol = SAMSUNGAH, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
+ SAMSUNGAH_START_BIT_PULSE_LEN_MIN, SAMSUNGAH_START_BIT_PULSE_LEN_MAX,
+ SAMSUNGAH_START_BIT_PAUSE_LEN_MIN, SAMSUNGAH_START_BIT_PAUSE_LEN_MAX);
+#endif // ANALYZE
+ irmp_param_p = (IRMP_PARAMETER *) &samsungah_param;
+ }
+ else
+#endif // IRMP_SUPPORT_SAMSUNGAH_PROTOCOL == 1
+
#if IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
if (irmp_pulse_time >= MATSUSHITA_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= MATSUSHITA_START_BIT_PULSE_LEN_MAX &&
irmp_pause_time >= MATSUSHITA_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= MATSUSHITA_START_BIT_PAUSE_LEN_MAX)
diff --git a/irmpconfig.h b/irmpconfig.h
index 9887ea0..245129f 100644
--- a/irmpconfig.h
+++ b/irmpconfig.h
@@ -6,7 +6,7 @@
* Copyright (c) 2009-2016 Frank Meyer - frank(at)fli4l.de
* Extensions for PIC 12F1820 W.Strobl 2014-07-20
*
- * $Id: irmpconfig.h,v 1.150 2016/09/19 14:28:24 fm Exp $
+ * $Id: irmpconfig.h,v 1.152 2017/02/17 09:13:06 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
@@ -99,6 +99,7 @@
#define IRMP_SUPPORT_PANASONIC_PROTOCOL 0 // PANASONIC Beamer >= 10000 ~250 bytes
#define IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL 0 // Mitsubishi Aircond >= 10000 ~250 bytes
#define IRMP_SUPPORT_VINCENT_PROTOCOL 0 // VINCENT >= 10000 ~250 bytes
+#define IRMP_SUPPORT_SAMSUNGAH_PROTOCOL 1 // SAMSUNG AH >= 10000 ~250 bytes
#define IRMP_SUPPORT_RADIO1_PROTOCOL 0 // RADIO, e.g. TEVION >= 10000 ~250 bytes (experimental)
/*---------------------------------------------------------------------------------------------------------------------------------------------------
@@ -155,7 +156,7 @@
* Change hardware pin here for ESP8266
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
-#elif defined (__xtensa__)
+#elif defined (__xtensa__)
# define IRMP_BIT_NUMBER 12 // use GPIO12 (Pin 7 UEXT) on ESP8266-EVB evaluation board
/*---------------------------------------------------------------------------------------------------------------------------------------------------
diff --git a/irmpextlog.c b/irmpextlog.c
index b3352ac..2845aa5 100644
--- a/irmpextlog.c
+++ b/irmpextlog.c
@@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* irmpextlog.c - external logging
*
- * $Id: irmpextlog.c,v 1.4 2014/02/19 12:57:36 fm Exp $
+ * $Id: irmpextlog.c,v 1.6 2017/02/17 09:13:06 fm Exp $
*
* If you cannot use the internal UART logging routine, adapt the
* source below for your application. The following implementation
@@ -36,7 +36,7 @@ void
initextlog (void) // reset all data to default, only during init
{
unsigned char i;
-
+
for (i = 0; i < loglen; i++)
{
logdata[i] = 0;
@@ -68,7 +68,7 @@ sendextlog (unsigned char data)
}
mUSBUSARTTxRam((unsigned char *) &logdata, loglen); // send all Data to main Seoftware
-
+
logindex = 3; // reset index
bitindex = 7; // reset bit position
logdata[logindex] = 0; // reset value of new logindex to 0
diff --git a/irmpprotocols.h b/irmpprotocols.h
index 0b38759..0ca55a6 100644
--- a/irmpprotocols.h
+++ b/irmpprotocols.h
@@ -5,7 +5,7 @@
*
* Copyright (c) 2013-2016 Frank Meyer - frank(at)fli4l.de
*
- * $Id: irmpprotocols.h,v 1.47 2016/09/14 06:31:48 fm Exp $
+ * $Id: irmpprotocols.h,v 1.48 2017/02/17 09:13:06 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
@@ -75,10 +75,11 @@
#define IRMP_PANASONIC_PROTOCOL 48 // Panasonic (Beamer), start bits similar to KASEIKYO
#define IRMP_MITSU_HEAVY_PROTOCOL 49 // Mitsubishi-Heavy Aircondition, similar timing as Panasonic beamer
#define IRMP_VINCENT_PROTOCOL 50 // Vincent
+#define IRMP_SAMSUNGAH_PROTOCOL 51 // Vincent
-#define IRMP_RADIO1_PROTOCOL 51 // Radio protocol (experimental status), do not use it yet!
+#define IRMP_RADIO1_PROTOCOL 52 // Radio protocol (experimental status), do not use it yet!
-#define IRMP_N_PROTOCOLS 52 // number of supported protocols
+#define IRMP_N_PROTOCOLS 53 // number of supported protocols
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* timing constants:
@@ -208,6 +209,25 @@ typedef uint8_t PAUSE_LEN;
#define SAMSUNG48_FRAME_REPEAT_PAUSE_TIME 47.0e-3 // frame repeat after 47ms
/*---------------------------------------------------------------------------------------------------------------------------------------------------
+ * SAMSUNGAH:
+ *---------------------------------------------------------------------------------------------------------------------------------------------------
+ */
+#define SAMSUNGAH_START_BIT_PULSE_TIME 2500.0e-6 // 2500 usec pulse
+#define SAMSUNGAH_START_BIT_PAUSE_TIME 1900.0e-6 // 1900 usec pause
+#define SAMSUNGAH_PULSE_TIME 450.0e-6 // 450 usec pulse
+#define SAMSUNGAH_1_PAUSE_TIME 1100.0e-6 // 1100 usec pause
+#define SAMSUNGAH_0_PAUSE_TIME 450.0e-6 // 450 usec pause
+#define SAMSUNGAH_FRAME_REPEAT_PAUSE_TIME 40.0e-3 // frame repeat after 40ms
+#define SAMSUNGAH_ADDRESS_OFFSET 0 // skip 0 bits
+#define SAMSUNGAH_ADDRESS_LEN 16 // read 16 address bits, ignore 17..31
+#define SAMSUNGAH_COMMAND_OFFSET 32 // skip 32 bits
+#define SAMSUNGAH_COMMAND_LEN 16 // read 32 bits
+#define SAMSUNGAH_COMPLETE_DATA_LEN 48 // complete length
+#define SAMSUNGAH_STOP_BIT 1 // has stop bit
+#define SAMSUNGAH_LSB 1 // LSB...MSB?
+#define SAMSUNGAH_FLAGS 0 // flags
+
+/*---------------------------------------------------------------------------------------------------------------------------------------------------
* MATSUSHITA:
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
diff --git a/irmpsystem.h b/irmpsystem.h
index 4cafdd5..25bacb2 100644
--- a/irmpsystem.h
+++ b/irmpsystem.h
@@ -3,7 +3,7 @@
*
* Copyright (c) 2009-2016 Frank Meyer - frank(at)fli4l.de
*
- * $Id: irmpsystem.h,v 1.24 2016/09/09 07:53:29 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
@@ -48,12 +48,13 @@
#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__)
+#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"
+# 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)
@@ -145,6 +146,10 @@ typedef unsigned short uint16_t;
# define PROGMEM
# define memcpy_P memcpy
+#elif defined(__xtensa__)
+# define PROGMEM
+# define memcpy_P memcpy
+
#elif defined(__MBED__)
# define PROGMEM
# define memcpy_P memcpy
diff --git a/irsnd.c b/irsnd.c
index 15692c1..1656bde 100644
--- a/irsnd.c
+++ b/irsnd.c
@@ -14,7 +14,7 @@
* ATmega164, ATmega324, ATmega644, ATmega644P, ATmega1284, ATmega1284P
* ATmega88, ATmega88P, ATmega168, ATmega168P, ATmega328P
*
- * $Id: irsnd.c,v 1.101 2016/09/09 07:53:29 fm Exp $
+ * $Id: irsnd.c,v 1.103 2017/02/17 09:13:06 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
@@ -149,19 +149,19 @@
# endif // IRSND_OCx
#elif defined (__AVR_ATmega8515__) // ATmega8515 uses OC0 = PB0 or OC1A = PD5 or OC1B = PE2
-# if IRSND_OCx == IRSND_OC0
+# if IRSND_OCx == IRSND_OC0
# define IRSND_PORT_LETTER B
# define IRSND_BIT_NUMBER 0
-# elif IRSND_OCx == IRSND_OC1A
+# elif IRSND_OCx == IRSND_OC1A
# define IRSND_PORT_LETTER D
# define IRSND_BIT_NUMBER 5
-# elif IRSND_OCx == IRSND_OC1B
+# elif IRSND_OCx == IRSND_OC1B
# define IRSND_PORT_LETTER E
# define IRSND_BIT_NUMBER 2
# endif // IRSND_OCx
#elif defined (__AVR_XMEGA__) // ATxmega
-# if IRSND_OCx == IRSND_XMEGA_OC0A
+# if IRSND_OCx == IRSND_XMEGA_OC0A
# define IRSND_BIT_NUMBER 0
# elif IRSND_OCx == IRSND_XMEGA_OC0B
# define IRSND_BIT_NUMBER 1
@@ -177,10 +177,13 @@
# error Wrong value for IRSND_OCx, choose IRSND_XMEGA_OC0A, IRSND_XMEGA_OC0B, IRSND_XMEGA_OC0C, IRSND_XMEGA_OC0D, IRSND_XMEGA_OC1A, or IRSND_XMEGA_OC1B in irsndconfig.h
# endif // IRSND_OCx
-#elif defined (PIC_C18) //Microchip C18 compiler
+#elif defined (PIC_C18) // Microchip C18 compiler
//Nothing here to do here -> See irsndconfig.h
-#elif defined (ARM_STM32) //STM32
+#elif defined (ARM_STM32) // STM32
//Nothing here to do here -> See irsndconfig.h
+#elif defined (__xtensa__) // ESP8266
+ //Nothing here to do here -> See irsndconfig.h
+
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* Macro digitalPinHasPWM bothers PIC_C18 compiler, but why?
*
@@ -418,6 +421,15 @@
# define IRSND_FREQ_40_KHZ (IRSND_FREQ_TYPE) (40000)
# define IRSND_FREQ_56_KHZ (IRSND_FREQ_TYPE) (56000)
# define IRSND_FREQ_455_KHZ (IRSND_FREQ_TYPE) (455000)
+#elif defined (__xtensa__) // ESP8266
+# define IRSND_FREQ_TYPE float
+# define IRSND_FREQ_30_KHZ (IRSND_FREQ_TYPE) (30000)
+# define IRSND_FREQ_32_KHZ (IRSND_FREQ_TYPE) (32000)
+# define IRSND_FREQ_36_KHZ (IRSND_FREQ_TYPE) (36000)
+# define IRSND_FREQ_38_KHZ (IRSND_FREQ_TYPE) (38000)
+# define IRSND_FREQ_40_KHZ (IRSND_FREQ_TYPE) (40000)
+# define IRSND_FREQ_56_KHZ (IRSND_FREQ_TYPE) (56000)
+# define IRSND_FREQ_455_KHZ (IRSND_FREQ_TYPE) (455000)
#else // AVR
# if F_CPU >= 16000000L
# define AVR_PRESCALER 8
@@ -535,11 +547,14 @@ irsnd_on (void)
# elif defined (TEENSY_ARM_CORTEX_M4) // TEENSY
analogWrite(IRSND_PIN, 33 * 255 / 100); // pwm 33%
-# elif defined (__AVR_XMEGA__)
+# elif defined (__xtensa__) // ESP8266 (Arduino)
+ analogWrite(IRSND_PIN, 33 * 1023 / 100); // pwm 33%
+
+# elif defined (__AVR_XMEGA__)
# if (IRSND_OCx == IRSND_XMEGA_OC0A) // use OC0A
- XMEGA_Timer.CTRLB |= (1<<TC0_CCAEN_bp); // Compare A
+ XMEGA_Timer.CTRLB |= (1<<TC0_CCAEN_bp); // Compare A
# elif (IRSND_OCx == IRSND_XMEGA_OC0B) // use OC0B
- XMEGA_Timer.CTRLB |= (1<<TC0_CCBEN_bp); // Compare B
+ XMEGA_Timer.CTRLB |= (1<<TC0_CCBEN_bp); // Compare B
# elif IRSND_OCx == IRSND_XMEGA_OC0C // use OC0C
XMEGA_Timer.CTRLB |= (1<<TC0_CCCEN_bp); // Compare C
# elif IRSND_OCx == IRSND_XMEGA_OC0D // use OC0D
@@ -593,33 +608,36 @@ irsnd_off (void)
if (irsnd_is_on)
{
#ifndef ANALYZE
-
-# if defined(PIC_C18) // PIC C18
+
+# if defined(PIC_C18) // PIC C18
PWMoff();
// IRSND_PIN = 1; //input mode -> disbale PWM output pin (0=PWM on, 1=PWM off)
-# elif defined (ARM_STM32) // STM32
- TIM_Cmd(IRSND_TIMER, DISABLE); // disable counter
- TIM_SelectOCxM(IRSND_TIMER, IRSND_TIMER_CHANNEL, TIM_ForcedAction_InActive); // force output inactive
- TIM_CCxCmd(IRSND_TIMER, IRSND_TIMER_CHANNEL, TIM_CCx_Enable); // enable OC-output (is being disabled in TIM_SelectOCxM())
- TIM_SetCounter(IRSND_TIMER, 0); // reset counter value
+# elif defined (ARM_STM32) // STM32
+ TIM_Cmd(IRSND_TIMER, DISABLE); // disable counter
+ TIM_SelectOCxM(IRSND_TIMER, IRSND_TIMER_CHANNEL, TIM_ForcedAction_InActive); // force output inactive
+ TIM_CCxCmd(IRSND_TIMER, IRSND_TIMER_CHANNEL, TIM_CCx_Enable); // enable OC-output (is being disabled in TIM_SelectOCxM())
+ TIM_SetCounter(IRSND_TIMER, 0); // reset counter value
-# elif defined (TEENSY_ARM_CORTEX_M4) // TEENSY
- analogWrite(IRSND_PIN, 0); // pwm off, LOW level
+# elif defined (TEENSY_ARM_CORTEX_M4) // TEENSY
+ analogWrite(IRSND_PIN, 0); // pwm off, LOW level
+
+# elif defined (__xtensa__) // ESP8266
+ analogWrite(IRSND_PIN, 0); // pwm off, LOW level
# elif defined (__AVR_XMEGA__)
-# if (IRSND_OCx == IRSND_XMEGA_OC0A) // use OC0A
+# if (IRSND_OCx == IRSND_XMEGA_OC0A) // use OC0A
XMEGA_Timer.CTRLB &= ~(1<<TC0_CCAEN_bp); // Compare A disconnected
-# elif (IRSND_OCx == IRSND_XMEGA_OC0B) // use OC0B
+# elif (IRSND_OCx == IRSND_XMEGA_OC0B) // use OC0B
XMEGA_Timer.CTRLB &= ~(1<<TC0_CCBEN_bp); // Compare B disconnected
# elif IRSND_OCx == IRSND_XMEGA_OC0C // use OC0C
XMEGA_Timer.CTRLB &= ~(1<<TC0_CCCEN_bp); // Compare C disconnected
# elif IRSND_OCx == IRSND_XMEGA_OC0D // use OC0D
XMEGA_Timer.CTRLB &= ~(1<<TC0_CCDEN_bp); // Compare D disconnected
# elif IRSND_OCx == IRSND_XMEGA_OC1A // use OC1A
- XMEGA_Timer.CTRLB &= ~(1<<TC1_CCAEN_bp); // Compare A disconnected
+ XMEGA_Timer.CTRLB &= ~(1<<TC1_CCAEN_bp); // Compare A disconnected
# elif IRSND_OCx == IRSND_XMEGA_OC1B // use OC1B
- XMEGA_Timer.CTRLB &= ~(1<<TC1_CCBEN_bp); // Compare B disconnected
+ XMEGA_Timer.CTRLB &= ~(1<<TC1_CCBEN_bp); // Compare B disconnected
# else
# error wrong value of IRSND_OCx
# endif // IRSND_OCx
@@ -672,7 +690,7 @@ irsnd_set_freq (IRSND_FREQ_TYPE freq)
#ifndef ANALYZE
# if defined(PIC_C18) // PIC C18 or XC8
# if defined(__12F1840) // XC8
- TRISA2=0;
+ TRISA2=0;
PR2=freq;
CCP1M0=1;
CCP1M1=1;
@@ -685,7 +703,7 @@ irsnd_set_freq (IRSND_FREQ_TYPE freq)
TMR2ON=1;
CCP1CON &=(~0b0011); // p 197 "active high"
# else // PIC C18
- OpenPWM(freq);
+ OpenPWM(freq);
SetDCPWM( (uint16_t) (freq * 2) + 1); // freq*2 = Duty cycles 50%
# endif
PWMoff();
@@ -726,9 +744,14 @@ irsnd_set_freq (IRSND_FREQ_TYPE freq)
TIM_SetCompare1(IRSND_TIMER, (freq + 1) / 2);
# elif defined (TEENSY_ARM_CORTEX_M4)
- analogWriteResolution(8); // 8 bit
+ analogWriteResolution(8); // 8 bit
analogWriteFrequency(IRSND_PIN, freq);
- analogWrite(IRSND_PIN, 0); // pwm off, LOW level
+ analogWrite(IRSND_PIN, 0); // pwm off, LOW level
+
+#elif defined (__xtensa__)
+ // analogWriteRange(255);
+ analogWriteFreq(freq);
+ analogWrite(IRSND_PIN, 0); // pwm off, LOW level
# elif defined (__AVR_XMEGA__)
XMEGA_Timer.CCA = freq;
@@ -834,6 +857,10 @@ irsnd_init (void)
return;
}
+# elif defined (__xtensa__)
+ pinMode(IRSND_PIN, OUTPUT);
+ irsnd_set_freq (IRSND_FREQ_36_KHZ);
+
# elif defined (__AVR_XMEGA__)
IRSND_PORT &= ~(1<<IRSND_BIT); // set IRSND_BIT to low
IRSND_DDR |= (1<<IRSND_BIT); // set IRSND_BIT to output
@@ -846,7 +873,7 @@ irsnd_init (void)
# else
XMEGA_Timer.CTRLA |= TC_CLKSEL_DIV1_gc; // start Timer prescaler = 1
# endif
-
+
# else // AVR
IRSND_PORT &= ~(1<<IRSND_BIT); // set IRSND_BIT to low
IRSND_DDR |= (1<<IRSND_BIT); // set IRSND_BIT to output
@@ -1208,11 +1235,11 @@ irsnd_send_data (IRMP_DATA * irmp_data_p, uint8_t do_wait)
#if IRSND_SUPPORT_RECS80_PROTOCOL == 1
case IRMP_RECS80_PROTOCOL:
{
- toggle_bit_recs80 = toggle_bit_recs80 ? 0x00 : 0x40;
+ toggle_bit_recs80 = toggle_bit_recs80 ? 0x00 : 0x80;
- irsnd_buffer[0] = 0x80 | toggle_bit_recs80 | ((irmp_data_p->address & 0x0007) << 3) |
- ((irmp_data_p->command & 0x0038) >> 3); // STAAACCC
- irsnd_buffer[1] = (irmp_data_p->command & 0x07) << 5; // CCC00000
+ irsnd_buffer[0] = toggle_bit_recs80 | ((irmp_data_p->address & 0x000F) << 4) |
+ ((irmp_data_p->command & 0x003C) >> 2); // TAAACCCC
+ irsnd_buffer[1] = (irmp_data_p->command & 0x03) << 6; // CC000000
irsnd_busy = TRUE;
break;
}
@@ -1438,7 +1465,7 @@ irsnd_send_data (IRMP_DATA * irmp_data_p, uint8_t do_wait)
irsnd_buffer[0] = ((command & 0x06) << 5) | ((address & 0x0003) << 4) | ((command & 0x0780) >> 7); // C0 C1 A0 A1 D0 D1 D2 D3
irsnd_buffer[1] = ((command & 0x78) << 1) | ((command & 0x0001) << 3); // D4 D5 D6 D7 V 0 0 0
-
+
irsnd_busy = TRUE;
break;
}
@@ -1528,9 +1555,9 @@ irsnd_send_data (IRMP_DATA * irmp_data_p, uint8_t do_wait)
// 1 2 3 4 5 6
// 0123456789012345678901234567890123456789012345678901234567890123456789
// N VVMMM ? ??? t vmA x y TTTT
- //
+ //
// irmp_data_p->command:
- //
+ //
// 5432109876543210
// NAVVvMMMmtxyTTTT
@@ -1700,7 +1727,7 @@ irsnd_ISR (void)
send_trailer = FALSE;
return irsnd_busy;
}
-
+
n_repeat_frames = irsnd_repeat;
if (n_repeat_frames == IRSND_ENDLESS_REPETITION)
diff --git a/irsnd.h b/irsnd.h
index 1e797d5..748a4ea 100644
--- a/irsnd.h
+++ b/irsnd.h
@@ -3,7 +3,7 @@
*
* Copyright (c) 2010-2016 Frank Meyer - frank(at)fli4l.de
*
- * $Id: irsnd.h,v 1.24 2016/01/12 21:15:16 fm Exp $
+ * $Id: irsnd.h,v 1.26 2017/02/17 09:13:07 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
@@ -52,12 +52,12 @@
# if defined(__12F1840)
// Do not change lines below unless you have a different HW. This example is for 12F1840
// setup macro for PWM used PWM module
-
+
//~ # define PWMon() TMR2=0,IRSND_PIN=1
//~ # define PWMoff() CCP1CON &=(~0b1100)
//~ # define PWMon() TMR2ON=1
//~ # define PWMoff() TMR2ON=0
- #if defined(IRSND_DEBUG)
+ #if defined(IRSND_DEBUG)
#define PWMon() LATA0=1
#define PWMoff() LATA0=0
#define IRSND_PIN LATA0
@@ -70,22 +70,22 @@
#else
// Do not change lines below until you have a different HW. Example is for 18F2550/18F4550
// setup macro for PWM used PWM module
- # if IRSND_OCx == IRSND_PIC_CCP2
+ # if IRSND_OCx == IRSND_PIC_CCP2
# define PWMon() TMR2=0,CCP2CON |=0b1100
# define PWMoff() CCP2CON &=(~0b1100)
# define IRSND_PIN TRISCbits.TRISC1 // RC1 = PWM2
- # define SetDCPWM(x) SetDCPWM2(x)
+ # define SetDCPWM(x) SetDCPWM2(x)
# define ClosePWM ClosePWM2
- # define OpenPWM(x) OpenPWM2(x)
+ # define OpenPWM(x) OpenPWM2(x)
# endif
- # if IRSND_OCx == IRSND_PIC_CCP1
+ # if IRSND_OCx == IRSND_PIC_CCP1
# define PWMon() TMR2=0,CCP1CON |=0b1100
# define PWMoff() CCP1CON &=(~0b1100)
# define IRSND_PIN TRISCbits.TRISC2 // RC2 = PWM1
# define SetDCPWM(x) SetDCPWM1(x)
# define ClosePWM ClosePWM1
# define OpenPWM(x) OpenPWM1(x)
- # endif
+ # endif
# endif
# endif // PIC_C18
diff --git a/irsndconfig.h b/irsndconfig.h
index bded8ed..8ed36bf 100644
--- a/irsndconfig.h
+++ b/irsndconfig.h
@@ -5,7 +5,7 @@
*
* Copyright (c) 2010-2016 Frank Meyer - frank(at)fli4l.de
*
- * $Id: irsndconfig.h,v 1.88 2016/09/09 07:53:29 fm Exp $
+ * $Id: irsndconfig.h,v 1.89 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
@@ -21,7 +21,7 @@
# error please include only irsnd.h, not irsndconfig.h
#endif
-//~ #define IRSND_DEBUG 1 // activate debugging
+// #define IRSND_DEBUG 1 // activate debugging
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* F_INTERRUPTS: number of interrupts per second, should be in the range from 10000 to 20000, typically 15000
@@ -48,7 +48,7 @@
// more protocols, enable here! Enable Remarks F_INTERRUPTS Program Space
#define IRSND_SUPPORT_DENON_PROTOCOL 0 // DENON, Sharp >= 10000 ~200 bytes
-#define IRSND_SUPPORT_RC5_PROTOCOL 0 // RC5 >= 10000 ~150 bytes
+#define IRSND_SUPPORT_RC5_PROTOCOL 1 // RC5 >= 10000 ~150 bytes
#define IRSND_SUPPORT_RC6_PROTOCOL 0 // RC6 >= 10000 ~250 bytes
#define IRSND_SUPPORT_RC6A_PROTOCOL 0 // RC6A >= 10000 ~250 bytes
#define IRSND_SUPPORT_JVC_PROTOCOL 0 // JVC >= 10000 ~150 bytes
@@ -102,7 +102,7 @@
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#if defined(__AVR_XMEGA__) // XMEGA
-# define IRSND_PORT_PRE PORTD
+# define IRSND_PORT_PRE PORTD
# define XMEGA_Timer TCD0
# define IRSND_OCx IRSND_XMEGA_OC0B // use OC0B
@@ -167,6 +167,13 @@
#endif
/*---------------------------------------------------------------------------------------------------------------------------------------------------
+ * ESP8266 (Arduino, see IRSEND.ino)
+ *---------------------------------------------------------------------------------------------------------------------------------------------------
+ */
+#elif defined (__xtensa__)
+# define IRSND_PIN 0 // choose an arduino pin with PWM function!
+
+/*---------------------------------------------------------------------------------------------------------------------------------------------------
* Use Callbacks to indicate output signal or something else
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/