/*---------------------------------------------------------------------------------------------------------------------------------------------------\r
* irmp.c - infrared multi-protocol decoder, supports several remote control protocols\r
*\r
- * Copyright (c) 2009-2010 Frank Meyer - frank(at)fli4l.de\r
+ * Copyright (c) 2009-2012 Frank Meyer - frank(at)fli4l.de\r
*\r
- * $Id: irmp.c,v 1.86 2011/01/13 15:54:57 fm Exp $\r
+ * $Id: irmp.c,v 1.121 2012/05/22 15:08:46 fm Exp $\r
*\r
* ATMEGA88 @ 8 MHz\r
*\r
- * Typical manufacturers:\r
+ * Supported mikrocontrollers:\r
*\r
- * SIRCS - Sony\r
- * NEC - NEC, Yamaha, Canon, Tevion, Harman/Kardon, Hitachi, JVC, Pioneer, Toshiba, Xoro, Orion, and many other Japanese manufacturers\r
- * SAMSUNG - Samsung\r
- * SAMSUNG32 - Samsung\r
- * MATSUSHITA - Matsushita\r
- * KASEIKYO - Panasonic, Denon & other Japanese manufacturers (members of "Japan's Association for Electric Home Application")\r
- * RECS80 - Philips, Nokia, Thomson, Nordmende, Telefunken, Saba\r
- * RC5 - Philips and other European manufacturers\r
- * DENON - Denon\r
- * RC6 - Philips and other European manufacturers\r
- * APPLE - Apple\r
- * NUBERT - Nubert Subwoofer System\r
- * B&O - Bang & Olufsen\r
- * PANASONIC - Panasonic (older, yet not implemented)\r
- * GRUNDIG - Grundig\r
- * NOKIA - Nokia\r
- * SIEMENS - Siemens, e.g. Gigaset M740AV\r
- *\r
- *---------------------------------------------------------------------------------------------------------------------------------------------------\r
- *\r
- * SIRCS\r
- * -----\r
- *\r
- * frame: 1 start bit + 12-20 data bits + no stop bit\r
- * data: 7 command bits + 5 address bits + 0 to 8 additional bits\r
- *\r
- * start bit: data "0": data "1": stop bit:\r
- * -----------------_________ ------_____ ------------______\r
- * 2400us 600us 600us 600us 1200us 600 us no stop bit\r
- *\r
- *---------------------------------------------------------------------------------------------------------------------------------------------------\r
- *\r
- * NEC + extended NEC\r
- * -------------------------\r
- *\r
- * frame: 1 start bit + 32 data bits + 1 stop bit\r
- * data NEC: 8 address bits + 8 inverted address bits + 8 command bits + 8 inverted command bits\r
- * data extended NEC: 16 address bits + 8 command bits + 8 inverted command bits\r
- *\r
- * start bit: data "0": data "1": stop bit:\r
- * -----------------_________ ------______ ------________________ ------______....\r
- * 9000us 4500us 560us 560us 560us 1690 us 560us\r
- *\r
- *\r
- * Repetition frame:\r
- *\r
- * -----------------_________------______ .... ~100ms Pause, then repeat\r
- * 9000us 2250us 560us\r
- *\r
- *---------------------------------------------------------------------------------------------------------------------------------------------------\r
- *\r
- * SAMSUNG\r
- * -------\r
- *\r
- * frame: 1 start bit + 16 data(1) bits + 1 sync bit + additional 20 data(2) bits + 1 stop bit\r
- * data(1): 16 address bits\r
- * data(2): 4 ID bits + 8 command bits + 8 inverted command bits\r
- *\r
- * start bit: data "0": data "1": sync bit: stop bit:\r
- * ----------______________ ------______ ------________________ ------______________ ------______....\r
- * 4500us 4500us 550us 450us 550us 1450us 550us 4500us 550us\r
- *\r
- *---------------------------------------------------------------------------------------------------------------------------------------------------\r
- *\r
- * SAMSUNG32\r
- * ----------\r
- *\r
- * frame: 1 start bit + 32 data bits + 1 stop bit\r
- * data: 16 address bits + 16 command bits\r
- *\r
- * start bit: data "0": data "1": stop bit:\r
- * ----------______________ ------______ ------________________ ------______....\r
- * 4500us 4500us 550us 450us 550us 1450us 550us\r
- *\r
- *---------------------------------------------------------------------------------------------------------------------------------------------------\r
- *\r
- * MATSUSHITA\r
- * ----------\r
- *\r
- * frame: 1 start bit + 24 data bits + 1 stop bit\r
- * data: 6 custom bits + 6 command bits + 12 address bits\r
- *\r
- * start bit: data "0": data "1": stop bit:\r
- * ----------_________ ------______ ------________________ ------______....\r
- * 3488us 3488us 872us 872us 872us 2616us 872us\r
- *\r
- *---------------------------------------------------------------------------------------------------------------------------------------------------\r
- *\r
- * KASEIKYO\r
- * --------\r
- *\r
- * frame: 1 start bit + 48 data bits + 1 stop bit\r
- * data: 16 manufacturer bits + 4 parity bits + 4 genre1 bits + 4 genre2 bits + 10 command bits + 2 id bits + 8 parity bits\r
- *\r
- * start bit: data "0": data "1": stop bit:\r
- * ----------______ ------______ ------________________ ------______....\r
- * 3380us 1690us 423us 423us 423us 1269us 423us\r
- *\r
- *---------------------------------------------------------------------------------------------------------------------------------------------------\r
- *\r
- * RECS80\r
- * ------\r
- *\r
- * frame: 2 start bits + 10 data bits + 1 stop bit\r
- * data: 1 toggle bit + 3 address bits + 6 command bits\r
- *\r
- * start bit: data "0": data "1": stop bit:\r
- * -----_____________________ -----____________ -----______________ ------_______....\r
- * 158us 7432us 158us 4902us 158us 7432us 158us\r
- *\r
- *---------------------------------------------------------------------------------------------------------------------------------------------------\r
- *\r
- * RECS80EXT\r
- * ---------\r
- *\r
- * frame: 2 start bits + 11 data bits + 1 stop bit\r
- * data: 1 toggle bit + 4 address bits + 6 command bits\r
- *\r
- * start bit: data "0": data "1": stop bit:\r
- * -----_____________________ -----____________ -----______________ ------_______....\r
- * 158us 3637us 158us 4902us 158us 7432us 158us\r
- *\r
- *---------------------------------------------------------------------------------------------------------------------------------------------------\r
- *\r
- * RC5 + RC5X\r
- * ----------\r
- *\r
- * RC5 frame: 2 start bits + 12 data bits + no stop bit\r
- * RC5 data: 1 toggle bit + 5 address bits + 6 command bits\r
- * RC5X frame: 1 start bit + 13 data bits + no stop bit\r
- * RC5X data: 1 inverted command bit + 1 toggle bit + 5 address bits + 6 command bits\r
- *\r
- * start bit: data "0": data "1":\r
- * ______----- ------______ ______------\r
- * 889us 889us 889us 889us 889us 889us\r
- *\r
- *---------------------------------------------------------------------------------------------------------------------------------------------------\r
- *\r
- * DENON\r
- * -----\r
- *\r
- * frame: 0 start bits + 16 data bits + stop bit + 65ms pause + 16 inverted data bits + stop bit\r
- * data: 5 address bits + 10 command bits\r
- *\r
- * data "0": data "1":\r
- * ------________________ ------______________\r
- * 275us 775us 275us 1900us\r
- *\r
- *---------------------------------------------------------------------------------------------------------------------------------------------------\r
- *\r
- * RC6\r
- * ---\r
- *\r
- * RC6 frame: 1 start bit + 1 bit "1" + 3 mode bits + 1 toggle bit + 16 data bits + 2666 µs pause\r
- * RC6 data: 8 address bits + 8 command bits\r
- *\r
- * start bit toggle bit "0": toggle bit "1": data/mode "0": data/mode "1":\r
- * ____________------- _______------- -------_______ _______------- -------_______\r
- * 2666us 889us 889us 889us 889us 889us 444us 444us 444us 444us\r
- *\r
- *---------------------------------------------------------------------------------------------------------------------------------------------------\r
- *\r
- * APPLE\r
- * -----\r
- *\r
- * frame: 1 start bit + 32 data bits + 1 stop bit\r
- * data: 16 address bits + 11100000 + 8 command bits\r
- *\r
- * start bit: data "0": data "1": stop bit:\r
- * -----------------_________ ------______ ------________________ ------______....\r
- * 9000us 4500us 560us 560us 560us 1690 us 560us\r
- *\r
- *---------------------------------------------------------------------------------------------------------------------------------------------------\r
- *\r
- * NUBERT (subwoofer system)\r
- * -------------------------\r
- *\r
- * frame: 1 start bit + 10 data bits + 1 stop bit\r
- * data: 0 address bits + 10 command bits ?\r
- *\r
- * start bit: data "0": data "1": stop bit:\r
- * ----------_____ ------______ ------________________ ------______....\r
- * 1340us 340us 500us 1300us 1340us 340us 500us\r
- *\r
- *---------------------------------------------------------------------------------------------------------------------------------------------------\r
- *\r
- * BANG_OLUFSEN\r
- * ------------\r
- *\r
- * frame: 4 start bits + 16 data bits + 1 trailer bit + 1 stop bit\r
- * data: 0 address bits + 16 command bits\r
- *\r
- * 1st start bit: 2nd start bit: 3rd start bit: 4th start bit:\r
- * -----________ -----________ -----_____________ -----________\r
- * 210us 3000us 210us 3000us 210us 15000us 210us 3000us\r
- *\r
- * data "0": data "1": data "repeat bit": trailer bit: stop bit:\r
- * -----________ -----_____________ -----___________ -----_____________ -----____...\r
- * 210us 3000us 210us 9000us 210us 6000us 210us 12000us 210us\r
- *\r
- *---------------------------------------------------------------------------------------------------------------------------------------------------\r
- *\r
- * GRUNDIG\r
- * -------\r
- *\r
- * packet: 1 start frame + 19,968ms pause + N info frames + 117,76ms pause + 1 stop frame\r
- * frame: 1 pre bit + 1 start bit + 9 data bits + no stop bit\r
- * pause between info frames: 117,76ms\r
- *\r
- * data of start frame: 9 x 1\r
- * data of info frame: 9 command bits\r
- * data of stop frame: 9 x 1\r
- *\r
- * pre bit: start bit data "0": data "1":\r
- * ------____________ ------______ ______------ ------______ \r
- * 528us 2639us 528us 528us 528us 528us 528us 528us\r
- *\r
- *---------------------------------------------------------------------------------------------------------------------------------------------------\r
- *\r
- * NOKIA:\r
- * ------\r
- *\r
- * Timing similar to Grundig, but 16 data bits:\r
- * frame: 1 pre bit + 1 start bit + 8 command bits + 8 address bits + no stop bit\r
- *\r
- *---------------------------------------------------------------------------------------------------------------------------------------------------\r
- *\r
- * SIEMENS:\r
- * --------\r
- *\r
- * SIEMENS frame: 1 start bit + 22 data bits + no stop bit\r
- * SIEMENS data: 13 address bits + 1 repeat bit + 7 data bits + 1 unknown bit\r
- *\r
- * start bit data "0": data "1":\r
- * -------_______ _______------- -------_______\r
- * 250us 250us 250us 250us 250us 250us\r
- *\r
- *---------------------------------------------------------------------------------------------------------------------------------------------------\r
- *\r
- * PANASONIC (older protocol, yet not implemented, see also MATSUSHITA, timing very similar)\r
- * -----------------------------------------------------------------------------------------\r
- *\r
- * frame: 1 start bit + 22 data bits + 1 stop bit\r
- * 22 data bits = 5 custom bits + 6 data bits + 5 inverted custom bits + 6 inverted data bits\r
- *\r
- * European version: T = 456us\r
- * USA & Canada version: T = 422us\r
- *\r
- * start bit: data "0": data "1": stop bit:\r
- * 8T 8T 2T 2T 2T 6T 2T\r
- * -------------____________ ------_____ ------_____________ ------_______....\r
- * 3648us 3648us 912us 912us 912us 2736us 912us (Europe)\r
- * 3376us 3376us 844us 844us 844us 2532us 844us (US)\r
- *\r
- *---------------------------------------------------------------------------------------------------------------------------------------------------\r
+ * ATtiny45, ATtiny85\r
+ * ATtiny84\r
+ * ATmega8, ATmega16, ATmega32\r
+ * ATmega162\r
+ * ATmega164, ATmega324, ATmega644, ATmega644P, ATmega1284\r
+ * ATmega88, ATmega88P, ATmega168, ATmega168P, ATmega328P\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
*---------------------------------------------------------------------------------------------------------------------------------------------------\r
*/\r
\r
-#if defined(__PCM__) || defined(__PCB__) || defined(__PCH__) // CCS PIC Compiler instead of AVR\r
-#define PIC_CCS_COMPILER\r
-#endif\r
-\r
-#ifdef unix // test on linux/unix\r
-#include <stdio.h>\r
-#include <unistd.h>\r
-#include <stdlib.h>\r
-#include <string.h>\r
-#include <inttypes.h>\r
-\r
-#define ANALYZE\r
-#define PROGMEM\r
-#define memcpy_P memcpy\r
-\r
-#else // not unix:\r
-\r
-#ifdef WIN32\r
-#include <stdio.h>\r
-#include <string.h>\r
-typedef unsigned char uint8_t;\r
-typedef unsigned short uint16_t;\r
-#define ANALYZE\r
-#define PROGMEM\r
-#define memcpy_P memcpy\r
+#include "irmp.h"\r
\r
+#if IRMP_SUPPORT_GRUNDIG_PROTOCOL == 1 || IRMP_SUPPORT_NOKIA_PROTOCOL == 1 || IRMP_SUPPORT_IR60_PROTOCOL == 1\r
+# define IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL 1\r
#else\r
+# define IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL 0\r
+#endif\r
\r
-#ifndef CODEVISION\r
-\r
-#ifdef PIC_CCS_COMPILER\r
-\r
-#include <string.h>\r
-typedef unsigned int8 uint8_t;\r
-typedef unsigned int16 uint16_t;\r
-#define PROGMEM\r
-#define memcpy_P memcpy\r
-\r
-#else // AVR:\r
-\r
-#include <inttypes.h>\r
-#include <stdio.h>\r
-#include <string.h>\r
-#include <avr/io.h>\r
-#include <util/delay.h>\r
-#include <avr/pgmspace.h>\r
-\r
-#endif // PIC_CCS_COMPILER\r
-#endif // CODEVISION\r
-\r
-#endif // windows\r
-#endif // unix\r
-\r
-#ifndef IRMP_USE_AS_LIB\r
-#include "irmpconfig.h"\r
+#if IRMP_SUPPORT_SIEMENS_PROTOCOL == 1 || IRMP_SUPPORT_RUWIDO_PROTOCOL == 1\r
+# define IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL 1\r
+#else\r
+# define IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL 0\r
#endif\r
-#include "irmp.h"\r
\r
-#if IRMP_SUPPORT_GRUNDIG_PROTOCOL == 1 || IRMP_SUPPORT_NOKIA_PROTOCOL == 1\r
-#define IRMP_SUPPORT_GRUNDIG_OR_NOKIA_PROTOCOL 1\r
+#if IRMP_SUPPORT_RC5_PROTOCOL == 1 || \\r
+ IRMP_SUPPORT_RC6_PROTOCOL == 1 || \\r
+ IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1 || \\r
+ IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1 || \\r
+ IRMP_SUPPORT_IR60_PROTOCOL\r
+# define IRMP_SUPPORT_MANCHESTER 1\r
#else\r
-#define IRMP_SUPPORT_GRUNDIG_OR_NOKIA_PROTOCOL 0\r
+# define IRMP_SUPPORT_MANCHESTER 0\r
#endif\r
\r
-#if IRMP_SUPPORT_RC5_PROTOCOL == 1 || IRMP_SUPPORT_RC6_PROTOCOL == 1 || IRMP_SUPPORT_GRUNDIG_OR_NOKIA_PROTOCOL == 1 || IRMP_SUPPORT_SIEMENS_PROTOCOL == 1 \r
-#define IRMP_SUPPORT_MANCHESTER 1\r
+#if IRMP_SUPPORT_NETBOX_PROTOCOL == 1\r
+# define IRMP_SUPPORT_SERIAL 1\r
#else\r
-#define IRMP_SUPPORT_MANCHESTER 0\r
+# define IRMP_SUPPORT_SERIAL 0\r
#endif\r
\r
#define IRMP_KEY_REPETITION_LEN (uint16_t)(F_INTERRUPTS * 150.0e-3 + 0.5) // autodetect key repetition within 150 msec\r
#define SIRCS_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIRCS_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
#define SIRCS_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIRCS_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
#define SIRCS_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r
-#define SIRCS_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1) // only 5% to avoid conflict with RC6\r
+#if IRMP_SUPPORT_NETBOX_PROTOCOL // only 5% to avoid conflict with NETBOX:\r
+# define SIRCS_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5))\r
+#else // only 5% + 1 to avoid conflict with RC6:\r
+# define SIRCS_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)\r
+#endif\r
#define SIRCS_1_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIRCS_1_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
#define SIRCS_1_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIRCS_1_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
#define SIRCS_0_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIRCS_0_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
#define SIRCS_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIRCS_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
#define SIRCS_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIRCS_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
\r
-#define NEC_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NEC_START_BIT_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r
-#define NEC_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NEC_START_BIT_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)\r
-#define NEC_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NEC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r
-#define NEC_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NEC_START_BIT_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)\r
-#define NEC_REPEAT_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NEC_REPEAT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r
-#define NEC_REPEAT_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NEC_REPEAT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)\r
-#define NEC_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NEC_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r
-#define NEC_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NEC_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)\r
-#define NEC_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NEC_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r
-#define NEC_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NEC_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)\r
-#define NEC_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NEC_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r
-#define NEC_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NEC_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)\r
+#define NEC_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NEC_START_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r
+#define NEC_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NEC_START_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)\r
+#define NEC_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NEC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r
+#define NEC_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NEC_START_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)\r
+#define NEC_REPEAT_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NEC_REPEAT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r
+#define NEC_REPEAT_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NEC_REPEAT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)\r
+#define NEC_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NEC_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r
+#define NEC_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NEC_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)\r
+#define NEC_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NEC_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r
+#define NEC_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NEC_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)\r
+#define NEC_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NEC_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r
+#define NEC_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NEC_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)\r
// autodetect nec repetition frame within 50 msec:\r
// NEC seems to send the first repetition frame after 40ms, further repetition frames after 100 ms\r
#if 0\r
\r
#define RC5_START_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
#define RC5_START_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+\r
#define RC5_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
#define RC5_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
\r
#define DENON_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
-#define DENON_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#define DENON_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r
#define DENON_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * DENON_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
#define DENON_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * DENON_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+// RUWIDO (see t-home-mediareceiver-15kHz.txt) conflicts here with DENON\r
#define DENON_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
#define DENON_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#define DENON_AUTO_REPETITION_PAUSE_LEN ((uint16_t)(F_INTERRUPTS * DENON_AUTO_REPETITION_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+\r
+#define THOMSON_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * THOMSON_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define THOMSON_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * THOMSON_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#define THOMSON_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * THOMSON_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define THOMSON_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * THOMSON_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#define THOMSON_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * THOMSON_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define THOMSON_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * THOMSON_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
\r
#define RC6_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC6_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
#define RC6_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC6_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
#define RC6_TOGGLE_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC6_TOGGLE_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
#define RC6_TOGGLE_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC6_TOGGLE_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
#define RC6_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC6_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
-#define RC6_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC6_BIT_TIME * MAX_TOLERANCE_30 + 0.5) + 1) // pulses: 300 - 700\r
-#define RC6_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC6_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1) // pauses: 300 - 600\r
-#define RC6_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC6_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#define RC6_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC6_BIT_TIME * MAX_TOLERANCE_60 + 0.5) + 1) // pulses: 300 - 800\r
+#define RC6_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC6_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define RC6_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC6_BIT_TIME * MAX_TOLERANCE_20 + 0.5) + 1) // pauses: 300 - 600\r
\r
#define RECS80EXT_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PULSE_TIME * MIN_TOLERANCE_00 + 0.5) - 1)\r
#define RECS80EXT_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PULSE_TIME * MAX_TOLERANCE_00 + 0.5) + 1)\r
#define BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_TRAILER_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
#define BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_TRAILER_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
\r
-#define GRUNDIG_OR_NOKIA_START_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * GRUNDIG_OR_NOKIA_BIT_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r
-#define GRUNDIG_OR_NOKIA_START_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * GRUNDIG_OR_NOKIA_BIT_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r
-#define GRUNDIG_OR_NOKIA_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * GRUNDIG_OR_NOKIA_BIT_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r
-#define GRUNDIG_OR_NOKIA_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * GRUNDIG_OR_NOKIA_BIT_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r
-#define GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * GRUNDIG_OR_NOKIA_PRE_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) + 1)\r
-#define GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * GRUNDIG_OR_NOKIA_PRE_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r
-\r
-#define SIEMENS_START_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIEMENS_BIT_TIME * 1 + 0.5) - 1)\r
-#define SIEMENS_START_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIEMENS_BIT_TIME * 1 + 0.5) + 1)\r
-#define SIEMENS_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIEMENS_BIT_TIME * 1 + 0.5) - 1)\r
-#define SIEMENS_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIEMENS_BIT_TIME * 1 + 0.5) + 1)\r
-\r
-#define FDC_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * FDC_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
-#define FDC_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * FDC_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
-#define FDC_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * FDC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
-#define FDC_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * FDC_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#define IR60_TIMEOUT_LEN ((uint8_t)(F_INTERRUPTS * IR60_TIMEOUT_TIME * 0.5))\r
+#define GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#define GRUNDIG_NOKIA_IR60_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define GRUNDIG_NOKIA_IR60_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#define GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_PRE_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) + 1)\r
+#define GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_PRE_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r
+\r
+#define SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#define SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#define SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#define SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+\r
+#define FDC_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * FDC_START_BIT_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1) // 5%: avoid conflict with NETBOX\r
+#define FDC_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * FDC_START_BIT_PULSE_TIME * MAX_TOLERANCE_05 + 0.5))\r
+#define FDC_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * FDC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)\r
+#define FDC_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * FDC_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5))\r
#define FDC_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * FDC_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r
#define FDC_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * FDC_PULSE_TIME * MAX_TOLERANCE_50 + 0.5) + 1)\r
#define FDC_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * FDC_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r
#define NIKON_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NIKON_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r
#define NIKON_FRAME_REPEAT_PAUSE_LEN_MAX (uint16_t)(F_INTERRUPTS * NIKON_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)\r
\r
+#define KATHREIN_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define KATHREIN_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#define KATHREIN_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define KATHREIN_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#define KATHREIN_1_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KATHREIN_1_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define KATHREIN_1_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KATHREIN_1_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#define KATHREIN_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KATHREIN_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define KATHREIN_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KATHREIN_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#define KATHREIN_0_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KATHREIN_0_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define KATHREIN_0_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KATHREIN_0_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#define KATHREIN_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KATHREIN_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define KATHREIN_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KATHREIN_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#define KATHREIN_SYNC_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KATHREIN_SYNC_BIT_PAUSE_LEN_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define KATHREIN_SYNC_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KATHREIN_SYNC_BIT_PAUSE_LEN_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+\r
+#define NETBOX_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NETBOX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define NETBOX_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NETBOX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#define NETBOX_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NETBOX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define NETBOX_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NETBOX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#define NETBOX_PULSE_LEN ((uint8_t)(F_INTERRUPTS * NETBOX_PULSE_TIME))\r
+#define NETBOX_PAUSE_LEN ((uint8_t)(F_INTERRUPTS * NETBOX_PAUSE_TIME))\r
+#define NETBOX_PULSE_REST_LEN ((uint8_t)(F_INTERRUPTS * NETBOX_PULSE_TIME / 4))\r
+#define NETBOX_PAUSE_REST_LEN ((uint8_t)(F_INTERRUPTS * NETBOX_PAUSE_TIME / 4))\r
+\r
+#define LEGO_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * LEGO_START_BIT_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r
+#define LEGO_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * LEGO_START_BIT_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)\r
+#define LEGO_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * LEGO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r
+#define LEGO_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * LEGO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)\r
+#define LEGO_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * LEGO_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r
+#define LEGO_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * LEGO_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)\r
+#define LEGO_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * LEGO_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r
+#define LEGO_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * LEGO_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)\r
+#define LEGO_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * LEGO_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r
+#define LEGO_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * LEGO_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)\r
+\r
#define AUTO_FRAME_REPETITION_LEN (uint16_t)(F_INTERRUPTS * AUTO_FRAME_REPETITION_TIME + 0.5) // use uint16_t!\r
\r
#ifdef ANALYZE\r
-#define ANALYZE_PUTCHAR(a) { if (! silent) { putchar (a); } }\r
-#define ANALYZE_ONLY_NORMAL_PUTCHAR(a) { if (! silent && !verbose) { putchar (a); } }\r
-#define ANALYZE_PRINTF(...) { if (verbose) { printf (__VA_ARGS__); } }\r
-#define ANALYZE_NEWLINE() { if (verbose) { putchar ('\n'); } }\r
-static int silent;\r
-static int time_counter;\r
-static int verbose;\r
+# define ANALYZE_PUTCHAR(a) { if (! silent) { putchar (a); } }\r
+# define ANALYZE_ONLY_NORMAL_PUTCHAR(a) { if (! silent && !verbose) { putchar (a); } }\r
+# define ANALYZE_PRINTF(...) { if (verbose) { printf (__VA_ARGS__); } }\r
+# define ANALYZE_NEWLINE() { if (verbose) { putchar ('\n'); } }\r
+static int silent;\r
+static int time_counter;\r
+static int verbose;\r
#else\r
-#define ANALYZE_PUTCHAR(a)\r
-#define ANALYZE_ONLY_NORMAL_PUTCHAR(a)\r
-#define ANALYZE_PRINTF(...)\r
-#define ANALYZE_NEWLINE()\r
+# define ANALYZE_PUTCHAR(a)\r
+# define ANALYZE_ONLY_NORMAL_PUTCHAR(a)\r
+# define ANALYZE_PRINTF(...)\r
+# define ANALYZE_NEWLINE()\r
#endif\r
\r
-#if IRMP_LOGGING == 1\r
+#if IRMP_USE_CALLBACK == 1\r
+static void (*irmp_callback_ptr) (uint8_t);\r
+#endif // IRMP_USE_CALLBACK == 1\r
+\r
+/*---------------------------------------------------------------------------------------------------------------------------------------------------\r
+ * Protocol names\r
+ *---------------------------------------------------------------------------------------------------------------------------------------------------\r
+ */\r
+#if IRMP_PROTOCOL_NAMES == 1\r
+char *\r
+irmp_protocol_names[IRMP_N_PROTOCOLS + 1] =\r
+{\r
+ "UNKNOWN",\r
+ "SIRCS",\r
+ "NEC",\r
+ "SAMSUNG",\r
+ "MATSUSH",\r
+ "KASEIKYO",\r
+ "RECS80",\r
+ "RC5",\r
+ "DENON",\r
+ "RC6",\r
+ "SAMSG32",\r
+ "APPLE",\r
+ "RECS80EX",\r
+ "NUBERT",\r
+ "BANG OLU",\r
+ "GRUNDIG",\r
+ "NOKIA",\r
+ "SIEMENS",\r
+ "FDC",\r
+ "RCCAR",\r
+ "JVC",\r
+ "RC6A",\r
+ "NIKON",\r
+ "RUWIDO",\r
+ "IR60",\r
+ "KATHREIN",\r
+ "NETBOX",\r
+ "NEC16",\r
+ "NEC42",\r
+ "LEGO",\r
+ "THOMSON"\r
+};\r
+#endif\r
+\r
+/*---------------------------------------------------------------------------------------------------------------------------------------------------\r
+ * Logging\r
+ *---------------------------------------------------------------------------------------------------------------------------------------------------\r
+ */\r
+#if IRMP_LOGGING == 1 // logging via UART\r
+\r
+#if IRMP_EXT_LOGGING == 1 // use external logging\r
+#include "irmpextlog.h"\r
+#else // normal UART log (IRMP_EXT_LOGGING == 0)\r
#define BAUD 9600L\r
#include <util/setbaud.h>\r
\r
#define UART0_TXEN_BIT_VALUE (1<<TXEN0)\r
#define UART0_UDR UDR0\r
#define UART0_U2X U2X0\r
-\r
+ \r
#else\r
\r
#define UART0_UBRRH UBRRH\r
#define UART0_UDR UDR\r
#define UART0_U2X U2X\r
\r
-#endif\r
+#endif //UBRR0H\r
+#endif //IRMP_EXT_LOGGING\r
\r
/*---------------------------------------------------------------------------------------------------------------------------------------------------\r
* Initialize UART\r
void\r
irmp_uart_init (void)\r
{\r
+#if (IRMP_EXT_LOGGING == 0) // use UART\r
UART0_UBRRH = UBRRH_VALUE; // set baud rate\r
UART0_UBRRL = UBRRL_VALUE;\r
\r
\r
UART0_UCSRC = UART0_UCSZ1_BIT_VALUE | UART0_UCSZ0_BIT_VALUE | UART0_URSEL_BIT_VALUE;\r
UART0_UCSRB |= UART0_TXEN_BIT_VALUE; // enable UART TX\r
+#else // other log method\r
+ initextlog(); \r
+#endif //IRMP_EXT_LOGGING\r
}\r
\r
/*---------------------------------------------------------------------------------------------------------------------------------------------------\r
void\r
irmp_uart_putc (unsigned char ch)\r
{\r
+#if (IRMP_EXT_LOGGING == 0)\r
while (!(UART0_UCSRA & UART0_UDRE_BIT_VALUE))\r
{\r
;\r
}\r
\r
UART0_UDR = ch;\r
+#else\r
+ sendextlog(ch); //Use external log\r
+#endif\r
}\r
\r
/*---------------------------------------------------------------------------------------------------------------------------------------------------\r
\r
#else\r
#define irmp_log(val)\r
-#endif\r
+#endif //IRMP_LOGGING\r
\r
typedef struct\r
{\r
\r
#if IRMP_SUPPORT_SIRCS_PROTOCOL == 1\r
\r
-static PROGMEM IRMP_PARAMETER sircs_param =\r
+static const PROGMEM IRMP_PARAMETER sircs_param =\r
{\r
IRMP_SIRCS_PROTOCOL, // protocol: ir protocol\r
SIRCS_1_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r
\r
#if IRMP_SUPPORT_NEC_PROTOCOL == 1\r
\r
-static PROGMEM IRMP_PARAMETER nec_param =\r
+static const PROGMEM IRMP_PARAMETER nec_param =\r
{\r
IRMP_NEC_PROTOCOL, // protocol: ir protocol\r
NEC_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r
NEC_FLAGS // flags: some flags\r
};\r
\r
-static PROGMEM IRMP_PARAMETER nec_rep_param =\r
+static const PROGMEM IRMP_PARAMETER nec_rep_param =\r
{\r
IRMP_NEC_PROTOCOL, // protocol: ir protocol\r
NEC_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r
\r
#endif\r
\r
+#if IRMP_SUPPORT_NEC42_PROTOCOL == 1\r
+\r
+static const PROGMEM IRMP_PARAMETER nec42_param =\r
+{\r
+ IRMP_NEC42_PROTOCOL, // protocol: ir protocol\r
+ NEC_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r
+ NEC_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r
+ NEC_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r
+ NEC_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r
+ NEC_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r
+ NEC_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r
+ NEC_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r
+ NEC_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r
+ NEC42_ADDRESS_OFFSET, // address_offset: address offset\r
+ NEC42_ADDRESS_OFFSET + NEC42_ADDRESS_LEN, // address_end: end of address\r
+ NEC42_COMMAND_OFFSET, // command_offset: command offset\r
+ NEC42_COMMAND_OFFSET + NEC42_COMMAND_LEN, // command_end: end of command\r
+ NEC42_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r
+ NEC_STOP_BIT, // stop_bit: flag: frame has stop bit\r
+ NEC_LSB, // lsb_first: flag: LSB first\r
+ NEC_FLAGS // flags: some flags\r
+};\r
+\r
+#endif\r
+\r
#if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1\r
\r
-static PROGMEM IRMP_PARAMETER samsung_param =\r
+static const PROGMEM IRMP_PARAMETER samsung_param =\r
{\r
IRMP_SAMSUNG_PROTOCOL, // protocol: ir protocol\r
SAMSUNG_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r
\r
#if IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1\r
\r
-static PROGMEM IRMP_PARAMETER matsushita_param =\r
+static const PROGMEM IRMP_PARAMETER matsushita_param =\r
{\r
IRMP_MATSUSHITA_PROTOCOL, // protocol: ir protocol\r
MATSUSHITA_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r
\r
#if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1\r
\r
-static PROGMEM IRMP_PARAMETER kaseikyo_param =\r
+static const PROGMEM IRMP_PARAMETER kaseikyo_param =\r
{\r
IRMP_KASEIKYO_PROTOCOL, // protocol: ir protocol\r
KASEIKYO_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r
\r
#if IRMP_SUPPORT_RECS80_PROTOCOL == 1\r
\r
-static PROGMEM IRMP_PARAMETER recs80_param =\r
+static const PROGMEM IRMP_PARAMETER recs80_param =\r
{\r
IRMP_RECS80_PROTOCOL, // protocol: ir protocol\r
RECS80_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r
\r
#if IRMP_SUPPORT_RC5_PROTOCOL == 1\r
\r
-static PROGMEM IRMP_PARAMETER rc5_param =\r
+static const PROGMEM IRMP_PARAMETER rc5_param =\r
{\r
IRMP_RC5_PROTOCOL, // protocol: ir protocol\r
- RC5_BIT_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r
- RC5_BIT_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r
- RC5_BIT_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r
- RC5_BIT_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r
- 1, // tricky: use this as stop bit length // pulse_0_len_min: minimum length of pulse with bit value 0\r
- 1, // pulse_0_len_max: maximum length of pulse with bit value 0\r
- 1, // pause_0_len_min: minimum length of pause with bit value 0\r
- 1, // pause_0_len_max: maximum length of pause with bit value 0\r
+ RC5_BIT_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse\r
+ RC5_BIT_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse\r
+ RC5_BIT_LEN_MIN, // pause_1_len_min: here: minimum length of short pause\r
+ RC5_BIT_LEN_MAX, // pause_1_len_max: here: maximum length of short pause\r
+ 0, // pulse_0_len_min: here: not used\r
+ 0, // pulse_0_len_max: here: not used\r
+ 0, // pause_0_len_min: here: not used\r
+ 0, // pause_0_len_max: here: not used\r
RC5_ADDRESS_OFFSET, // address_offset: address offset\r
RC5_ADDRESS_OFFSET + RC5_ADDRESS_LEN, // address_end: end of address\r
RC5_COMMAND_OFFSET, // command_offset: command offset\r
\r
#if IRMP_SUPPORT_DENON_PROTOCOL == 1\r
\r
-static PROGMEM IRMP_PARAMETER denon_param =\r
+static const PROGMEM IRMP_PARAMETER denon_param =\r
{\r
IRMP_DENON_PROTOCOL, // protocol: ir protocol\r
DENON_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r
\r
#if IRMP_SUPPORT_RC6_PROTOCOL == 1\r
\r
-static PROGMEM IRMP_PARAMETER rc6_param =\r
+static const PROGMEM IRMP_PARAMETER rc6_param =\r
{\r
IRMP_RC6_PROTOCOL, // protocol: ir protocol\r
- RC6_BIT_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r
- RC6_BIT_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r
- RC6_BIT_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r
- RC6_BIT_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r
- 1, // tricky: use this as stop bit length // pulse_0_len_min: minimum length of pulse with bit value 0\r
- 1, // pulse_0_len_max: maximum length of pulse with bit value 0\r
- 1, // pause_0_len_min: minimum length of pause with bit value 0\r
- 1, // pause_0_len_max: maximum length of pause with bit value 0\r
+\r
+ RC6_BIT_PULSE_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse\r
+ RC6_BIT_PULSE_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse\r
+ RC6_BIT_PAUSE_LEN_MIN, // pause_1_len_min: here: minimum length of short pause\r
+ RC6_BIT_PAUSE_LEN_MAX, // pause_1_len_max: here: maximum length of short pause\r
+ 0, // pulse_0_len_min: here: not used\r
+ 0, // pulse_0_len_max: here: not used\r
+ 0, // pause_0_len_min: here: not used\r
+ 0, // pause_0_len_max: here: not used\r
RC6_ADDRESS_OFFSET, // address_offset: address offset\r
RC6_ADDRESS_OFFSET + RC6_ADDRESS_LEN, // address_end: end of address\r
RC6_COMMAND_OFFSET, // command_offset: command offset\r
\r
#if IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1\r
\r
-static PROGMEM IRMP_PARAMETER recs80ext_param =\r
+static const PROGMEM IRMP_PARAMETER recs80ext_param =\r
{\r
IRMP_RECS80EXT_PROTOCOL, // protocol: ir protocol\r
RECS80EXT_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r
\r
#if IRMP_SUPPORT_NUBERT_PROTOCOL == 1\r
\r
-static PROGMEM IRMP_PARAMETER nubert_param =\r
+static const PROGMEM IRMP_PARAMETER nubert_param =\r
{\r
IRMP_NUBERT_PROTOCOL, // protocol: ir protocol\r
NUBERT_1_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r
\r
#if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1\r
\r
-static PROGMEM IRMP_PARAMETER bang_olufsen_param =\r
+static const PROGMEM IRMP_PARAMETER bang_olufsen_param =\r
{\r
IRMP_BANG_OLUFSEN_PROTOCOL, // protocol: ir protocol\r
BANG_OLUFSEN_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r
\r
#endif\r
\r
-#if IRMP_SUPPORT_GRUNDIG_OR_NOKIA_PROTOCOL == 1\r
+#if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1\r
+\r
+static uint8_t first_bit;\r
\r
-static PROGMEM IRMP_PARAMETER grundig_param =\r
+static const PROGMEM IRMP_PARAMETER grundig_param =\r
{\r
IRMP_GRUNDIG_PROTOCOL, // protocol: ir protocol\r
- GRUNDIG_OR_NOKIA_BIT_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r
- GRUNDIG_OR_NOKIA_BIT_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r
- GRUNDIG_OR_NOKIA_BIT_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r
- GRUNDIG_OR_NOKIA_BIT_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r
- 1, // tricky: use this as stop bit length // pulse_0_len_min: minimum length of pulse with bit value 0\r
- 1, // pulse_0_len_max: maximum length of pulse with bit value 0\r
- 1, // pause_0_len_min: minimum length of pause with bit value 0\r
- 1, // pause_0_len_max: maximum length of pause with bit value 0\r
+\r
+ GRUNDIG_NOKIA_IR60_BIT_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse\r
+ GRUNDIG_NOKIA_IR60_BIT_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse\r
+ GRUNDIG_NOKIA_IR60_BIT_LEN_MIN, // pause_1_len_min: here: minimum length of short pause\r
+ GRUNDIG_NOKIA_IR60_BIT_LEN_MAX, // pause_1_len_max: here: maximum length of short pause\r
+ 0, // pulse_0_len_min: here: not used\r
+ 0, // pulse_0_len_max: here: not used\r
+ 0, // pause_0_len_min: here: not used\r
+ 0, // pause_0_len_max: here: not used\r
GRUNDIG_ADDRESS_OFFSET, // address_offset: address offset\r
GRUNDIG_ADDRESS_OFFSET + GRUNDIG_ADDRESS_LEN, // address_end: end of address\r
GRUNDIG_COMMAND_OFFSET, // command_offset: command offset\r
GRUNDIG_COMMAND_OFFSET + GRUNDIG_COMMAND_LEN + 1, // command_end: end of command (USE 1 bit MORE to STORE NOKIA DATA!)\r
NOKIA_COMPLETE_DATA_LEN, // complete_len: complete length of frame, here: NOKIA instead of GRUNDIG!\r
- GRUNDIG_OR_NOKIA_STOP_BIT, // stop_bit: flag: frame has stop bit\r
- GRUNDIG_OR_NOKIA_LSB, // lsb_first: flag: LSB first\r
- GRUNDIG_OR_NOKIA_FLAGS // flags: some flags\r
+ GRUNDIG_NOKIA_IR60_STOP_BIT, // stop_bit: flag: frame has stop bit\r
+ GRUNDIG_NOKIA_IR60_LSB, // lsb_first: flag: LSB first\r
+ GRUNDIG_NOKIA_IR60_FLAGS // flags: some flags\r
};\r
\r
#endif\r
\r
-#if IRMP_SUPPORT_SIEMENS_PROTOCOL == 1\r
+#if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1\r
\r
-static PROGMEM IRMP_PARAMETER siemens_param =\r
+static const PROGMEM IRMP_PARAMETER ruwido_param =\r
{\r
- IRMP_SIEMENS_PROTOCOL, // protocol: ir protocol\r
- SIEMENS_BIT_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r
- SIEMENS_BIT_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r
- SIEMENS_BIT_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r
- SIEMENS_BIT_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r
- 1, // tricky: use this as stop bit length // pulse_0_len_min: minimum length of pulse with bit value 0\r
- 1, // pulse_0_len_max: maximum length of pulse with bit value 0\r
- 1, // pause_0_len_min: minimum length of pause with bit value 0\r
- 1, // pause_0_len_max: maximum length of pause with bit value 0\r
- SIEMENS_ADDRESS_OFFSET, // address_offset: address offset\r
- SIEMENS_ADDRESS_OFFSET + SIEMENS_ADDRESS_LEN, // address_end: end of address\r
- SIEMENS_COMMAND_OFFSET, // command_offset: command offset\r
- SIEMENS_COMMAND_OFFSET + SIEMENS_COMMAND_LEN, // command_end: end of command\r
- SIEMENS_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r
- SIEMENS_STOP_BIT, // stop_bit: flag: frame has stop bit\r
- SIEMENS_LSB, // lsb_first: flag: LSB first\r
- SIEMENS_FLAGS // flags: some flags\r
+ IRMP_RUWIDO_PROTOCOL, // protocol: ir protocol\r
+ SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse\r
+ SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse\r
+ SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN, // pause_1_len_min: here: minimum length of short pause\r
+ SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX, // pause_1_len_max: here: maximum length of short pause\r
+ 0, // pulse_0_len_min: here: not used\r
+ 0, // pulse_0_len_max: here: not used\r
+ 0, // pause_0_len_min: here: not used\r
+ 0, // pause_0_len_max: here: not used\r
+ RUWIDO_ADDRESS_OFFSET, // address_offset: address offset\r
+ RUWIDO_ADDRESS_OFFSET + RUWIDO_ADDRESS_LEN, // address_end: end of address\r
+ RUWIDO_COMMAND_OFFSET, // command_offset: command offset\r
+ RUWIDO_COMMAND_OFFSET + RUWIDO_COMMAND_LEN, // command_end: end of command\r
+ SIEMENS_COMPLETE_DATA_LEN, // complete_len: complete length of frame, here: SIEMENS instead of RUWIDO!\r
+ SIEMENS_OR_RUWIDO_STOP_BIT, // stop_bit: flag: frame has stop bit\r
+ SIEMENS_OR_RUWIDO_LSB, // lsb_first: flag: LSB first\r
+ SIEMENS_OR_RUWIDO_FLAGS // flags: some flags\r
};\r
\r
#endif\r
\r
#if IRMP_SUPPORT_FDC_PROTOCOL == 1\r
\r
-static PROGMEM IRMP_PARAMETER fdc_param =\r
+static const PROGMEM IRMP_PARAMETER fdc_param =\r
{\r
IRMP_FDC_PROTOCOL, // protocol: ir protocol\r
FDC_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r
\r
#if IRMP_SUPPORT_RCCAR_PROTOCOL == 1\r
\r
-static PROGMEM IRMP_PARAMETER rccar_param =\r
+static const PROGMEM IRMP_PARAMETER rccar_param =\r
{\r
IRMP_RCCAR_PROTOCOL, // protocol: ir protocol\r
RCCAR_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r
\r
#if IRMP_SUPPORT_NIKON_PROTOCOL == 1\r
\r
-static PROGMEM IRMP_PARAMETER nikon_param =\r
+static const PROGMEM IRMP_PARAMETER nikon_param =\r
{\r
IRMP_NIKON_PROTOCOL, // protocol: ir protocol\r
NIKON_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r
\r
#endif\r
\r
+#if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1\r
+\r
+static const PROGMEM IRMP_PARAMETER kathrein_param =\r
+{\r
+ IRMP_KATHREIN_PROTOCOL, // protocol: ir protocol\r
+ KATHREIN_1_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r
+ KATHREIN_1_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r
+ KATHREIN_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r
+ KATHREIN_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r
+ KATHREIN_0_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r
+ KATHREIN_0_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r
+ KATHREIN_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r
+ KATHREIN_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r
+ KATHREIN_ADDRESS_OFFSET, // address_offset: address offset\r
+ KATHREIN_ADDRESS_OFFSET + KATHREIN_ADDRESS_LEN, // address_end: end of address\r
+ KATHREIN_COMMAND_OFFSET, // command_offset: command offset\r
+ KATHREIN_COMMAND_OFFSET + KATHREIN_COMMAND_LEN, // command_end: end of command\r
+ KATHREIN_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r
+ KATHREIN_STOP_BIT, // stop_bit: flag: frame has stop bit\r
+ KATHREIN_LSB, // lsb_first: flag: LSB first\r
+ KATHREIN_FLAGS // flags: some flags\r
+};\r
+\r
+#endif\r
+\r
+#if IRMP_SUPPORT_NETBOX_PROTOCOL == 1\r
+\r
+static const PROGMEM IRMP_PARAMETER netbox_param =\r
+{\r
+ IRMP_NETBOX_PROTOCOL, // protocol: ir protocol\r
+ NETBOX_PULSE_LEN, // pulse_1_len_min: minimum length of pulse with bit value 1, here: exact value\r
+ NETBOX_PULSE_REST_LEN, // pulse_1_len_max: maximum length of pulse with bit value 1, here: rest value\r
+ NETBOX_PAUSE_LEN, // pause_1_len_min: minimum length of pause with bit value 1, here: exact value\r
+ NETBOX_PAUSE_REST_LEN, // pause_1_len_max: maximum length of pause with bit value 1, here: rest value\r
+ NETBOX_PULSE_LEN, // pulse_0_len_min: minimum length of pulse with bit value 0, here: exact value\r
+ NETBOX_PULSE_REST_LEN, // pulse_0_len_max: maximum length of pulse with bit value 0, here: rest value\r
+ NETBOX_PAUSE_LEN, // pause_0_len_min: minimum length of pause with bit value 0, here: exact value\r
+ NETBOX_PAUSE_REST_LEN, // pause_0_len_max: maximum length of pause with bit value 0, here: rest value\r
+ NETBOX_ADDRESS_OFFSET, // address_offset: address offset\r
+ NETBOX_ADDRESS_OFFSET + NETBOX_ADDRESS_LEN, // address_end: end of address\r
+ NETBOX_COMMAND_OFFSET, // command_offset: command offset\r
+ NETBOX_COMMAND_OFFSET + NETBOX_COMMAND_LEN, // command_end: end of command\r
+ NETBOX_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r
+ NETBOX_STOP_BIT, // stop_bit: flag: frame has stop bit\r
+ NETBOX_LSB, // lsb_first: flag: LSB first\r
+ NETBOX_FLAGS // flags: some flags\r
+};\r
+\r
+#endif\r
+\r
+#if IRMP_SUPPORT_LEGO_PROTOCOL == 1\r
+\r
+static const PROGMEM IRMP_PARAMETER lego_param =\r
+{\r
+ IRMP_LEGO_PROTOCOL, // protocol: ir protocol\r
+ LEGO_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r
+ LEGO_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r
+ LEGO_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r
+ LEGO_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r
+ LEGO_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r
+ LEGO_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r
+ LEGO_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r
+ LEGO_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r
+ LEGO_ADDRESS_OFFSET, // address_offset: address offset\r
+ LEGO_ADDRESS_OFFSET + LEGO_ADDRESS_LEN, // address_end: end of address\r
+ LEGO_COMMAND_OFFSET, // command_offset: command offset\r
+ LEGO_COMMAND_OFFSET + LEGO_COMMAND_LEN, // command_end: end of command\r
+ LEGO_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r
+ LEGO_STOP_BIT, // stop_bit: flag: frame has stop bit\r
+ LEGO_LSB, // lsb_first: flag: LSB first\r
+ LEGO_FLAGS // flags: some flags\r
+};\r
+\r
+#endif\r
+\r
+#if IRMP_SUPPORT_THOMSON_PROTOCOL == 1\r
+\r
+static const PROGMEM IRMP_PARAMETER thomson_param =\r
+{\r
+ IRMP_THOMSON_PROTOCOL, // protocol: ir protocol\r
+ THOMSON_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r
+ THOMSON_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r
+ THOMSON_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r
+ THOMSON_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r
+ THOMSON_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r
+ THOMSON_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r
+ THOMSON_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r
+ THOMSON_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r
+ THOMSON_ADDRESS_OFFSET, // address_offset: address offset\r
+ THOMSON_ADDRESS_OFFSET + THOMSON_ADDRESS_LEN, // address_end: end of address\r
+ THOMSON_COMMAND_OFFSET, // command_offset: command offset\r
+ THOMSON_COMMAND_OFFSET + THOMSON_COMMAND_LEN, // command_end: end of command\r
+ THOMSON_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r
+ THOMSON_STOP_BIT, // stop_bit: flag: frame has stop bit\r
+ THOMSON_LSB, // lsb_first: flag: LSB first\r
+ THOMSON_FLAGS // flags: some flags\r
+};\r
+\r
+#endif\r
+\r
static uint8_t irmp_bit; // current bit position\r
static IRMP_PARAMETER irmp_param;\r
\r
static volatile uint16_t irmp_command;\r
static volatile uint16_t irmp_id; // only used for SAMSUNG protocol\r
static volatile uint8_t irmp_flags;\r
+// static volatile uint8_t irmp_busy_flag;\r
\r
#ifdef ANALYZE\r
+#define input(x) (x)\r
static uint8_t IRMP_PIN;\r
#endif\r
\r
void\r
irmp_init (void)\r
{\r
-#ifndef PIC_CCS_COMPILER\r
+#if defined(PIC_CCS) || defined(PIC_C18) // PIC: do nothing\r
+#elif defined (ARM_STM32) // STM32\r
+ GPIO_InitTypeDef GPIO_InitStructure;\r
+\r
+ /* GPIOx clock enable */\r
+ #if defined (ARM_STM32L1XX)\r
+ RCC_AHBPeriphClockCmd(IRMP_PORT_RCC, ENABLE);\r
+ #elif defined (ARM_STM32F10X)\r
+ RCC_APB2PeriphClockCmd(IRMP_PORT_RCC, ENABLE);\r
+ #elif defined (ARM_STM32F4XX)\r
+ RCC_AHB1PeriphClockCmd(IRMP_PORT_RCC, ENABLE);\r
+ #endif\r
+\r
+ /* GPIO Configuration */\r
+ GPIO_InitStructure.GPIO_Pin = IRMP_BIT;\r
+ #if defined (ARM_STM32L1XX) || defined (ARM_STM32F4XX)\r
+ GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;\r
+ GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;\r
+ GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;\r
+ GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;\r
+ #elif defined (ARM_STM32F10X)\r
+ GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;\r
+ GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;\r
+ #endif\r
+ GPIO_Init(IRMP_PORT, &GPIO_InitStructure);\r
+\r
+ /* GPIO Configuration */\r
+ GPIO_InitStructure.GPIO_Pin = IRMP_BIT;\r
+ GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;\r
+ GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;\r
+ GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;\r
+ GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;\r
+ GPIO_Init(IRMP_PORT, &GPIO_InitStructure);\r
+#else // AVR\r
IRMP_PORT &= ~(1<<IRMP_BIT); // deactivate pullup\r
IRMP_DDR &= ~(1<<IRMP_BIT); // set pin to input\r
-#endif // PIC_CCS_COMPILER\r
+#endif\r
\r
#if IRMP_LOGGING == 1\r
irmp_uart_init ();\r
}\r
break;\r
#endif\r
-#if IRMP_SUPPORT_SIEMENS_PROTOCOL == 1\r
+#if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1\r
case IRMP_SIEMENS_PROTOCOL:\r
+ case IRMP_RUWIDO_PROTOCOL:\r
if (((irmp_command >> 1) & 0x0001) == (~irmp_command & 0x0001))\r
{\r
irmp_command >>= 1;\r
}\r
break;\r
#endif\r
+#if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1\r
+ case IRMP_KATHREIN_PROTOCOL:\r
+ if (irmp_command != 0x0000)\r
+ {\r
+ rtc = TRUE;\r
+ }\r
+ break;\r
+#endif\r
+#if IRMP_SUPPORT_RC5_PROTOCOL == 1\r
+ case IRMP_RC5_PROTOCOL:\r
+ irmp_address &= ~0x20; // clear toggle bit\r
+ rtc = TRUE;\r
+ break;\r
+#endif\r
+#if IRMP_SUPPORT_IR60_PROTOCOL == 1\r
+ case IRMP_IR60_PROTOCOL:\r
+ if (irmp_command != 0x007d) // 0x007d (== 62<<1 + 1) is start instruction frame\r
+ {\r
+ rtc = TRUE;\r
+ }\r
+ else\r
+ {\r
+ ANALYZE_PRINTF("Info IR60: got start instruction frame\n");\r
+ }\r
+ break;\r
+#endif\r
#if IRMP_SUPPORT_RCCAR_PROTOCOL == 1\r
case IRMP_RCCAR_PROTOCOL:\r
// frame in irmp_data:\r
rtc = TRUE; // Summe: V C1 C0 D7 D6 D5 D4 D3 D2 D1 D0\r
break;\r
#endif\r
+\r
+#if IRMP_SUPPORT_NETBOX_PROTOCOL == 1 // squeeze code to 8 bit, upper bit indicates release-key\r
+ case IRMP_NETBOX_PROTOCOL:\r
+ if (irmp_command & 0x1000) // last bit set?\r
+ {\r
+ if ((irmp_command & 0x1f) == 0x15) // key pressed: 101 01 (LSB)\r
+ {\r
+ irmp_command >>= 5;\r
+ irmp_command &= 0x7F;\r
+ rtc = TRUE;\r
+ }\r
+ else if ((irmp_command & 0x1f) == 0x10) // key released: 000 01 (LSB)\r
+ {\r
+ irmp_command >>= 5;\r
+ irmp_command |= 0x80;\r
+ rtc = TRUE;\r
+ }\r
+ else\r
+ {\r
+ ANALYZE_PRINTF("error NETBOX: bit6/7 must be 0/1\n");\r
+ }\r
+ }\r
+ else\r
+ {\r
+ ANALYZE_PRINTF("error NETBOX: last bit not set\n");\r
+ }\r
+ break;\r
+#endif\r
+#if IRMP_SUPPORT_LEGO_PROTOCOL == 1\r
+ case IRMP_LEGO_PROTOCOL:\r
+ {\r
+ uint8_t crc = 0x0F ^ ((irmp_command & 0xF000) >> 12) ^ ((irmp_command & 0x0F00) >> 8) ^ ((irmp_command & 0x00F0) >> 4);\r
+\r
+ if ((irmp_command & 0x000F) == crc)\r
+ {\r
+ irmp_command >>= 4;\r
+ rtc = TRUE;\r
+ }\r
+ else\r
+ {\r
+ ANALYZE_PRINTF ("CRC error in LEGO protocol\n");\r
+ rtc = TRUE;\r
+ }\r
+ break;\r
+ }\r
+#endif\r
default:\r
+ {\r
rtc = TRUE;\r
+ break;\r
+ }\r
}\r
\r
if (rtc)\r
return rtc;\r
}\r
\r
+// uint8_t\r
+// irmp_is_busy (void)\r
+// {\r
+// return irmp_busy_flag;\r
+// }\r
+\r
+#if IRMP_USE_CALLBACK == 1\r
+void\r
+irmp_set_callback_ptr (void (*cb)(uint8_t))\r
+{\r
+ irmp_callback_ptr = cb;\r
+}\r
+#endif // IRMP_USE_CALLBACK == 1\r
+\r
// these statics must not be volatile, because they are only used by irmp_store_bit(), which is called by irmp_ISR()\r
static uint16_t irmp_tmp_address; // ir address\r
static uint16_t irmp_tmp_command; // ir command\r
\r
-#if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)\r
+#if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1) || IRMP_SUPPORT_NEC42_PROTOCOL == 1\r
static uint16_t irmp_tmp_address2; // ir address\r
static uint16_t irmp_tmp_command2; // ir command\r
#endif\r
#endif\r
#if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1\r
static uint8_t xor_check[6]; // check kaseikyo "parity" bits\r
+static uint8_t genre2; // save genre2 bits here, later copied to MSB in flags\r
#endif\r
\r
-static uint8_t irmp_bit; // current bit position\r
-\r
/*---------------------------------------------------------------------------------------------------------------------------------------------------\r
* store bit\r
* @details store bit in temp address or temp command\r
static void\r
irmp_store_bit (uint8_t value)\r
{\r
+#if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1\r
+ if (irmp_bit == 0 && irmp_param.protocol == IRMP_GRUNDIG_PROTOCOL)\r
+ {\r
+ first_bit = value;\r
+ }\r
+ else\r
+#endif\r
\r
if (irmp_bit >= irmp_param.address_offset && irmp_bit < irmp_param.address_end)\r
{\r
}\r
}\r
\r
-#if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1\r
- else if (irmp_param.protocol == IRMP_SAMSUNG_PROTOCOL && irmp_bit >= SAMSUNG_ID_OFFSET && irmp_bit < SAMSUNG_ID_OFFSET + SAMSUNG_ID_LEN)\r
+#if IRMP_SUPPORT_NEC42_PROTOCOL == 1\r
+ if (irmp_param.protocol == IRMP_NEC42_PROTOCOL && irmp_bit >= 13 && irmp_bit < 26)\r
{\r
- irmp_tmp_id |= (((uint16_t) (value)) << (irmp_bit - SAMSUNG_ID_OFFSET)); // store with LSB first\r
+ irmp_tmp_address2 |= (((uint16_t) (value)) << (irmp_bit - 13)); // CV wants cast\r
}\r
+ else\r
#endif\r
\r
-#if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1\r
- else if (irmp_param.protocol == IRMP_KASEIKYO_PROTOCOL && irmp_bit >= 20 && irmp_bit < 24)\r
+#if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1\r
+ if (irmp_param.protocol == IRMP_SAMSUNG_PROTOCOL && irmp_bit >= SAMSUNG_ID_OFFSET && irmp_bit < SAMSUNG_ID_OFFSET + SAMSUNG_ID_LEN)\r
{\r
- irmp_tmp_command |= (((uint16_t) (value)) << (irmp_bit - 8)); // store 4 system bits in upper nibble with LSB first\r
+ irmp_tmp_id |= (((uint16_t) (value)) << (irmp_bit - SAMSUNG_ID_OFFSET)); // store with LSB first\r
}\r
+ else\r
+#endif\r
\r
- if (irmp_param.protocol == IRMP_KASEIKYO_PROTOCOL && irmp_bit < KASEIKYO_COMPLETE_DATA_LEN)\r
+#if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1\r
+ if (irmp_param.protocol == IRMP_KASEIKYO_PROTOCOL)\r
{\r
- if (value)\r
+ if (irmp_bit >= 20 && irmp_bit < 24)\r
{\r
- xor_check[irmp_bit / 8] |= 1 << (irmp_bit % 8);\r
+ irmp_tmp_command |= (((uint16_t) (value)) << (irmp_bit - 8)); // store 4 system bits (genre 1) in upper nibble with LSB first\r
}\r
- else\r
+ else if (irmp_bit >= 24 && irmp_bit < 28)\r
{\r
- xor_check[irmp_bit / 8] &= ~(1 << (irmp_bit % 8));\r
+ genre2 |= (((uint8_t) (value)) << (irmp_bit - 20)); // store 4 system bits (genre 2) in upper nibble with LSB first\r
}\r
- }\r
\r
+ if (irmp_bit < KASEIKYO_COMPLETE_DATA_LEN)\r
+ {\r
+ if (value)\r
+ {\r
+ xor_check[irmp_bit / 8] |= 1 << (irmp_bit % 8);\r
+ }\r
+ else\r
+ {\r
+ xor_check[irmp_bit / 8] &= ~(1 << (irmp_bit % 8));\r
+ }\r
+ }\r
+ }\r
#endif\r
\r
irmp_bit++;\r
\r
irmp_input = input(IRMP_PIN);\r
\r
+#if IRMP_USE_CALLBACK == 1\r
+ if (irmp_callback_ptr)\r
+ {\r
+ static uint8_t last_inverted_input;\r
+\r
+ if (last_inverted_input != !irmp_input)\r
+ {\r
+ (*irmp_callback_ptr) (! irmp_input);\r
+ last_inverted_input = !irmp_input;\r
+ }\r
+ }\r
+#endif // IRMP_USE_CALLBACK == 1\r
+\r
irmp_log(irmp_input); // log ir signal, if IRMP_LOGGING defined\r
\r
if (! irmp_ir_detected) // ir code already detected?\r
{ // no...\r
if (! irmp_input) // receiving burst?\r
{ // yes...\r
+// irmp_busy_flag = TRUE;\r
#ifdef ANALYZE\r
if (! irmp_pulse_time)\r
{\r
- ANALYZE_PRINTF("%8d [starting pulse]\n", time_counter);\r
+ ANALYZE_PRINTF("%8.3fms [starting pulse]\n", (double) (time_counter * 1000) / F_INTERRUPTS);\r
}\r
#endif\r
irmp_pulse_time++; // increment counter\r
wait_for_space = 0;\r
irmp_tmp_command = 0;\r
irmp_tmp_address = 0;\r
+#if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1\r
+ genre2 = 0;\r
+#endif\r
\r
-#if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)\r
+#if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1) || IRMP_SUPPORT_NEC42_PROTOCOL == 1\r
irmp_tmp_command2 = 0;\r
irmp_tmp_address2 = 0;\r
#endif\r
if (repetition_len < 0xFFFF) // avoid overflow of counter\r
{\r
repetition_len++;\r
+\r
+#if IRMP_SUPPORT_DENON_PROTOCOL == 1\r
+ if (repetition_len >= DENON_AUTO_REPETITION_PAUSE_LEN && last_irmp_denon_command != 0)\r
+ {\r
+ ANALYZE_PRINTF ("%8.3fms error 6: did not receive inverted command repetition\n",\r
+ (double) (time_counter * 1000) / F_INTERRUPTS);\r
+ last_irmp_denon_command = 0;\r
+ }\r
+#endif // IRMP_SUPPORT_DENON_PROTOCOL == 1\r
}\r
}\r
}\r
else\r
#endif // IRMP_SUPPORT_JVC_PROTOCOL == 1\r
{\r
- ANALYZE_PRINTF ("%8d error 1: pause after start bit pulse %d too long: %d\n", time_counter, irmp_pulse_time, irmp_pause_time);\r
+ ANALYZE_PRINTF ("%8.3fms error 1: pause after start bit pulse %d too long: %d\n", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_pulse_time, irmp_pause_time);\r
ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');\r
}\r
+// irmp_busy_flag = FALSE;\r
irmp_start_bit_detected = 0; // reset flags, let's wait for another start bit\r
irmp_pulse_time = 0;\r
irmp_pause_time = 0;\r
irmp_param2.protocol = 0;\r
#endif\r
\r
- ANALYZE_PRINTF ("%8d [start-bit: pulse = %2d, pause = %2d]\n", time_counter, irmp_pulse_time, irmp_pause_time);\r
+ ANALYZE_PRINTF ("%8.3fms [start-bit: pulse = %2d, pause = %2d]\n", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_pulse_time, irmp_pause_time);\r
\r
#if IRMP_SUPPORT_SIRCS_PROTOCOL == 1\r
if (irmp_pulse_time >= SIRCS_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= SIRCS_START_BIT_PULSE_LEN_MAX &&\r
irmp_pulse_time >= JVC_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= JVC_START_BIT_PULSE_LEN_MAX &&\r
irmp_pause_time >= JVC_REPEAT_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= JVC_REPEAT_START_BIT_PAUSE_LEN_MAX)\r
{\r
- ANALYZE_PRINTF ("protocol = NEC or JVC repeat frame, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ ANALYZE_PRINTF ("protocol = NEC or JVC (type 1) repeat frame, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
JVC_START_BIT_PULSE_LEN_MIN, JVC_START_BIT_PULSE_LEN_MAX,\r
JVC_REPEAT_START_BIT_PAUSE_LEN_MIN, JVC_REPEAT_START_BIT_PAUSE_LEN_MAX);\r
- irmp_param_p = (IRMP_PARAMETER *) &nec_param; // tricky: use nec parameters\r
+ irmp_param_p = (IRMP_PARAMETER *) &nec_param;\r
}\r
else\r
#endif // IRMP_SUPPORT_JVC_PROTOCOL == 1\r
if (irmp_pulse_time >= NEC_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= NEC_START_BIT_PULSE_LEN_MAX &&\r
irmp_pause_time >= NEC_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= NEC_START_BIT_PAUSE_LEN_MAX)\r
{\r
+#if IRMP_SUPPORT_NEC42_PROTOCOL == 1\r
+ ANALYZE_PRINTF ("protocol = NEC42, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ NEC_START_BIT_PULSE_LEN_MIN, NEC_START_BIT_PULSE_LEN_MAX,\r
+ NEC_START_BIT_PAUSE_LEN_MIN, NEC_START_BIT_PAUSE_LEN_MAX);\r
+ irmp_param_p = (IRMP_PARAMETER *) &nec42_param;\r
+#else\r
ANALYZE_PRINTF ("protocol = NEC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
NEC_START_BIT_PULSE_LEN_MIN, NEC_START_BIT_PULSE_LEN_MAX,\r
NEC_START_BIT_PAUSE_LEN_MIN, NEC_START_BIT_PAUSE_LEN_MAX);\r
irmp_param_p = (IRMP_PARAMETER *) &nec_param;\r
+#endif\r
+\r
}\r
else if (irmp_pulse_time >= NEC_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= NEC_START_BIT_PULSE_LEN_MAX &&\r
irmp_pause_time >= NEC_REPEAT_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= NEC_REPEAT_START_BIT_PAUSE_LEN_MAX)\r
{ // it's NEC\r
- ANALYZE_PRINTF ("protocol = NEC (repetition frame), start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- NEC_START_BIT_PULSE_LEN_MIN, NEC_START_BIT_PULSE_LEN_MAX,\r
- NEC_REPEAT_START_BIT_PAUSE_LEN_MIN, NEC_REPEAT_START_BIT_PAUSE_LEN_MAX);\r
+#if IRMP_SUPPORT_JVC_PROTOCOL == 1\r
+ if (irmp_protocol == IRMP_JVC_PROTOCOL) // last protocol was JVC, awaiting repeat frame\r
+ { // some jvc remote controls use nec repetition frame for jvc repetition frame\r
+ ANALYZE_PRINTF ("protocol = JVC repeat frame type 2, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ NEC_START_BIT_PULSE_LEN_MIN, NEC_START_BIT_PULSE_LEN_MAX,\r
+ NEC_REPEAT_START_BIT_PAUSE_LEN_MIN, NEC_REPEAT_START_BIT_PAUSE_LEN_MAX);\r
+ irmp_param_p = (IRMP_PARAMETER *) &nec_param;\r
+ }\r
+ else\r
+#endif // IRMP_SUPPORT_JVC_PROTOCOL == 1\r
+ {\r
+ ANALYZE_PRINTF ("protocol = NEC (repetition frame), start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ NEC_START_BIT_PULSE_LEN_MIN, NEC_START_BIT_PULSE_LEN_MAX,\r
+ NEC_REPEAT_START_BIT_PAUSE_LEN_MIN, NEC_REPEAT_START_BIT_PAUSE_LEN_MAX);\r
\r
- irmp_param_p = (IRMP_PARAMETER *) &nec_rep_param;\r
+ irmp_param_p = (IRMP_PARAMETER *) &nec_rep_param;\r
+ }\r
+ }\r
+ else\r
+\r
+#if IRMP_SUPPORT_JVC_PROTOCOL == 1\r
+ if (irmp_protocol == IRMP_JVC_PROTOCOL && // last protocol was JVC, awaiting repeat frame\r
+ irmp_pulse_time >= NEC_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= NEC_START_BIT_PULSE_LEN_MAX &&\r
+ irmp_pause_time >= NEC_0_PAUSE_LEN_MIN && irmp_pause_time <= NEC_0_PAUSE_LEN_MAX)\r
+ { // it's JVC repetition type 3\r
+ ANALYZE_PRINTF ("protocol = JVC repeat frame type 3, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ NEC_START_BIT_PULSE_LEN_MIN, NEC_START_BIT_PULSE_LEN_MAX,\r
+ NEC_0_PAUSE_LEN_MIN, NEC_0_PAUSE_LEN_MAX);\r
+ irmp_param_p = (IRMP_PARAMETER *) &nec_param;\r
}\r
else\r
+#endif // IRMP_SUPPORT_JVC_PROTOCOL == 1\r
+\r
#endif // IRMP_SUPPORT_NEC_PROTOCOL == 1\r
\r
#if IRMP_SUPPORT_NIKON_PROTOCOL == 1\r
#endif // IRMP_SUPPORT_RECS80_PROTOCOL == 1\r
\r
#if IRMP_SUPPORT_RC5_PROTOCOL == 1\r
- if (((irmp_pulse_time >= RC5_START_BIT_LEN_MIN && irmp_pulse_time <= RC5_START_BIT_LEN_MAX) ||\r
+ if (((irmp_pulse_time >= RC5_START_BIT_LEN_MIN && irmp_pulse_time <= RC5_START_BIT_LEN_MAX) ||\r
(irmp_pulse_time >= 2 * RC5_START_BIT_LEN_MIN && irmp_pulse_time <= 2 * RC5_START_BIT_LEN_MAX)) &&\r
- ((irmp_pause_time >= RC5_START_BIT_LEN_MIN && irmp_pause_time <= RC5_START_BIT_LEN_MAX) ||\r
+ ((irmp_pause_time >= RC5_START_BIT_LEN_MIN && irmp_pause_time <= RC5_START_BIT_LEN_MAX) ||\r
(irmp_pause_time >= 2 * RC5_START_BIT_LEN_MIN && irmp_pause_time <= 2 * RC5_START_BIT_LEN_MAX)))\r
{ // it's RC5\r
#if IRMP_SUPPORT_FDC_PROTOCOL == 1\r
}\r
else\r
#endif // IRMP_SUPPORT_FDC_PROTOCOL == 1\r
+\r
#if IRMP_SUPPORT_RCCAR_PROTOCOL == 1\r
if (irmp_pulse_time >= RCCAR_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= RCCAR_START_BIT_PULSE_LEN_MAX &&\r
irmp_pause_time >= RCCAR_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= RCCAR_START_BIT_PAUSE_LEN_MAX)\r
else\r
#endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1\r
{\r
- ANALYZE_PRINTF ("protocol = RC5, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ ANALYZE_PRINTF ("protocol = RC5, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or pulse: %3d - %3d, pause: %3d - %3d\n",\r
RC5_START_BIT_LEN_MIN, RC5_START_BIT_LEN_MAX,\r
- RC5_START_BIT_LEN_MIN, RC5_START_BIT_LEN_MAX);\r
+ 2 * RC5_START_BIT_LEN_MIN, 2 * RC5_START_BIT_LEN_MAX,\r
+ RC5_START_BIT_LEN_MIN, RC5_START_BIT_LEN_MAX,\r
+ 2 * RC5_START_BIT_LEN_MIN, 2 * RC5_START_BIT_LEN_MAX);\r
}\r
\r
irmp_param_p = (IRMP_PARAMETER *) &rc5_param;\r
else\r
#endif // IRMP_SUPPORT_DENON_PROTOCOL == 1\r
\r
+#if IRMP_SUPPORT_THOMSON_PROTOCOL == 1\r
+ if ( (irmp_pulse_time >= THOMSON_PULSE_LEN_MIN && irmp_pulse_time <= THOMSON_PULSE_LEN_MAX) &&\r
+ ((irmp_pause_time >= THOMSON_1_PAUSE_LEN_MIN && irmp_pause_time <= THOMSON_1_PAUSE_LEN_MAX) ||\r
+ (irmp_pause_time >= THOMSON_0_PAUSE_LEN_MIN && irmp_pause_time <= THOMSON_0_PAUSE_LEN_MAX)))\r
+ { // it's THOMSON\r
+ ANALYZE_PRINTF ("protocol = THOMSON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or %3d - %3d\n",\r
+ THOMSON_PULSE_LEN_MIN, THOMSON_PULSE_LEN_MAX,\r
+ THOMSON_1_PAUSE_LEN_MIN, THOMSON_1_PAUSE_LEN_MAX,\r
+ THOMSON_0_PAUSE_LEN_MIN, THOMSON_0_PAUSE_LEN_MAX);\r
+ irmp_param_p = (IRMP_PARAMETER *) &thomson_param;\r
+ }\r
+ else\r
+#endif // IRMP_SUPPORT_THOMSON_PROTOCOL == 1\r
+\r
#if IRMP_SUPPORT_RC6_PROTOCOL == 1\r
if (irmp_pulse_time >= RC6_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= RC6_START_BIT_PULSE_LEN_MAX &&\r
irmp_pause_time >= RC6_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= RC6_START_BIT_PAUSE_LEN_MAX)\r
else\r
#endif // IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1\r
\r
-#if IRMP_SUPPORT_GRUNDIG_OR_NOKIA_PROTOCOL == 1\r
- if (irmp_pulse_time >= GRUNDIG_OR_NOKIA_START_BIT_LEN_MIN && irmp_pulse_time <= GRUNDIG_OR_NOKIA_START_BIT_LEN_MAX &&\r
- irmp_pause_time >= GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN_MIN && irmp_pause_time <= GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN_MAX)\r
+#if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1\r
+ if (irmp_pulse_time >= GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN && irmp_pulse_time <= GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX &&\r
+ irmp_pause_time >= GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN && irmp_pause_time <= GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX)\r
{ // it's GRUNDIG\r
ANALYZE_PRINTF ("protocol = GRUNDIG, pre bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- GRUNDIG_OR_NOKIA_START_BIT_LEN_MIN, GRUNDIG_OR_NOKIA_START_BIT_LEN_MAX,\r
- GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN_MIN, GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN_MAX);\r
+ GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN, GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX,\r
+ GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN, GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX);\r
irmp_param_p = (IRMP_PARAMETER *) &grundig_param;\r
last_pause = irmp_pause_time;\r
last_value = 1;\r
}\r
else\r
-#endif // IRMP_SUPPORT_GRUNDIG_OR_NOKIA_PROTOCOL == 1\r
-\r
-#if IRMP_SUPPORT_SIEMENS_PROTOCOL == 1\r
- if (((irmp_pulse_time >= SIEMENS_START_BIT_LEN_MIN && irmp_pulse_time <= SIEMENS_START_BIT_LEN_MAX) ||\r
- (irmp_pulse_time >= 2 * SIEMENS_START_BIT_LEN_MIN && irmp_pulse_time <= 2 * SIEMENS_START_BIT_LEN_MAX)) &&\r
- ((irmp_pause_time >= SIEMENS_START_BIT_LEN_MIN && irmp_pause_time <= SIEMENS_START_BIT_LEN_MAX) ||\r
- (irmp_pause_time >= 2 * SIEMENS_START_BIT_LEN_MIN && irmp_pause_time <= 2 * SIEMENS_START_BIT_LEN_MAX)))\r
- { // it's SIEMENS\r
- ANALYZE_PRINTF ("protocol = SIEMENS, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- SIEMENS_START_BIT_LEN_MIN, SIEMENS_START_BIT_LEN_MAX,\r
- SIEMENS_START_BIT_LEN_MIN, SIEMENS_START_BIT_LEN_MAX);\r
- irmp_param_p = (IRMP_PARAMETER *) &siemens_param;\r
+#endif // IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1\r
+\r
+#if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1\r
+ if (((irmp_pulse_time >= SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX) ||\r
+ (irmp_pulse_time >= 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX)) &&\r
+ ((irmp_pause_time >= SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX) || \r
+ (irmp_pause_time >= 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX)))\r
+ { // it's RUWIDO or SIEMENS\r
+ ANALYZE_PRINTF ("protocol = RUWIDO, start bit timings: pulse: %3d - %3d or %3d - %3d, pause: %3d - %3d or %3d - %3d\n",\r
+ SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN, SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX,\r
+ 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN, 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX,\r
+ SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN, SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX,\r
+ 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN, 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX);\r
+ irmp_param_p = (IRMP_PARAMETER *) &ruwido_param;\r
last_pause = irmp_pause_time;\r
last_value = 1;\r
}\r
else\r
-#endif // IRMP_SUPPORT_SIEMENS_PROTOCOL == 1\r
+#endif // IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1\r
+\r
#if IRMP_SUPPORT_FDC_PROTOCOL == 1\r
if (irmp_pulse_time >= FDC_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= FDC_START_BIT_PULSE_LEN_MAX &&\r
irmp_pause_time >= FDC_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= FDC_START_BIT_PAUSE_LEN_MAX)\r
}\r
else\r
#endif // IRMP_SUPPORT_FDC_PROTOCOL == 1\r
+\r
#if IRMP_SUPPORT_RCCAR_PROTOCOL == 1\r
if (irmp_pulse_time >= RCCAR_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= RCCAR_START_BIT_PULSE_LEN_MAX &&\r
irmp_pause_time >= RCCAR_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= RCCAR_START_BIT_PAUSE_LEN_MAX)\r
}\r
else\r
#endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1\r
+\r
+#if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1\r
+ if (irmp_pulse_time >= KATHREIN_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= KATHREIN_START_BIT_PULSE_LEN_MAX &&\r
+ irmp_pause_time >= KATHREIN_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= KATHREIN_START_BIT_PAUSE_LEN_MAX)\r
+ { // it's KATHREIN\r
+ ANALYZE_PRINTF ("protocol = KATHREIN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ KATHREIN_START_BIT_PULSE_LEN_MIN, KATHREIN_START_BIT_PULSE_LEN_MAX,\r
+ KATHREIN_START_BIT_PAUSE_LEN_MIN, KATHREIN_START_BIT_PAUSE_LEN_MAX);\r
+ irmp_param_p = (IRMP_PARAMETER *) &kathrein_param;\r
+ }\r
+ else\r
+#endif // IRMP_SUPPORT_KATHREIN_PROTOCOL == 1\r
+\r
+#if IRMP_SUPPORT_NETBOX_PROTOCOL == 1\r
+ if (irmp_pulse_time >= NETBOX_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= NETBOX_START_BIT_PULSE_LEN_MAX &&\r
+ irmp_pause_time >= NETBOX_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= NETBOX_START_BIT_PAUSE_LEN_MAX)\r
+ { // it's NETBOX\r
+ ANALYZE_PRINTF ("protocol = NETBOX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ NETBOX_START_BIT_PULSE_LEN_MIN, NETBOX_START_BIT_PULSE_LEN_MAX,\r
+ NETBOX_START_BIT_PAUSE_LEN_MIN, NETBOX_START_BIT_PAUSE_LEN_MAX);\r
+ irmp_param_p = (IRMP_PARAMETER *) &netbox_param;\r
+ }\r
+ else\r
+#endif // IRMP_SUPPORT_NETBOX_PROTOCOL == 1\r
+\r
+#if IRMP_SUPPORT_LEGO_PROTOCOL == 1\r
+ if (irmp_pulse_time >= LEGO_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= LEGO_START_BIT_PULSE_LEN_MAX &&\r
+ irmp_pause_time >= LEGO_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= LEGO_START_BIT_PAUSE_LEN_MAX)\r
+ {\r
+ ANALYZE_PRINTF ("protocol = LEGO, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ LEGO_START_BIT_PULSE_LEN_MIN, LEGO_START_BIT_PULSE_LEN_MAX,\r
+ LEGO_START_BIT_PAUSE_LEN_MIN, LEGO_START_BIT_PAUSE_LEN_MAX);\r
+ irmp_param_p = (IRMP_PARAMETER *) &lego_param;\r
+ }\r
+ else\r
+#endif // IRMP_SUPPORT_LEGO_PROTOCOL == 1\r
+\r
{\r
ANALYZE_PRINTF ("protocol = UNKNOWN\n");\r
+// irmp_busy_flag = FALSE;\r
irmp_start_bit_detected = 0; // wait for another start bit...\r
}\r
\r
else\r
{\r
ANALYZE_PRINTF ("pulse: %3d - %3d or %3d - %3d\n", irmp_param.pulse_1_len_min, irmp_param.pulse_1_len_max,\r
- irmp_param.pulse_1_len_max + 1, 2 * irmp_param.pulse_1_len_max);\r
+ 2 * irmp_param.pulse_1_len_min, 2 * irmp_param.pulse_1_len_max);\r
ANALYZE_PRINTF ("pause: %3d - %3d or %3d - %3d\n", irmp_param.pause_1_len_min, irmp_param.pause_1_len_max,\r
- irmp_param.pause_1_len_max + 1, 2 * irmp_param.pause_1_len_max);\r
+ 2 * irmp_param.pause_1_len_min, 2 * irmp_param.pause_1_len_max);\r
}\r
\r
#if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)\r
ANALYZE_PRINTF ("pulse_0: %3d - %3d\n", irmp_param.pulse_0_len_min, irmp_param.pulse_0_len_max);\r
ANALYZE_PRINTF ("pause_0: %3d - %3d\n", irmp_param.pause_0_len_min, irmp_param.pause_0_len_max);\r
}\r
+ else\r
+ {\r
+ ANALYZE_PRINTF ("pulse: %3d - %3d or %3d - %3d\n", irmp_param.pulse_0_len_min, irmp_param.pulse_0_len_max,\r
+ 2 * irmp_param.pulse_0_len_min, 2 * irmp_param.pulse_0_len_max);\r
+ ANALYZE_PRINTF ("pause: %3d - %3d or %3d - %3d\n", irmp_param.pause_0_len_min, irmp_param.pause_0_len_max,\r
+ 2 * irmp_param.pause_0_len_min, 2 * irmp_param.pause_0_len_max);\r
+ }\r
\r
#if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1\r
if (irmp_param.protocol == IRMP_BANG_OLUFSEN_PROTOCOL)\r
irmp_bit = 0;\r
\r
#if IRMP_SUPPORT_MANCHESTER == 1\r
- if ((irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER) && irmp_param.protocol != IRMP_RC6_PROTOCOL) // Manchester, but not RC6\r
+ if ((irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER) &&\r
+ irmp_param.protocol != IRMP_RUWIDO_PROTOCOL && // Manchester, but not RUWIDO\r
+ irmp_param.protocol != IRMP_RC6_PROTOCOL) // Manchester, but not RC6\r
{\r
if (irmp_pause_time > irmp_param.pulse_1_len_max && irmp_pause_time <= 2 * irmp_param.pulse_1_len_max)\r
{\r
- ANALYZE_PRINTF ("%8d [bit %2d: pulse = %3d, pause = %3d] ", time_counter, irmp_bit, irmp_pulse_time, irmp_pause_time);\r
+ ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_bit, irmp_pulse_time, irmp_pause_time);\r
ANALYZE_PUTCHAR ((irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? '0' : '1');\r
ANALYZE_NEWLINE ();\r
irmp_store_bit ((irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? 0 : 1);\r
}\r
else if (! last_value) // && irmp_pause_time >= irmp_param.pause_1_len_min && irmp_pause_time <= irmp_param.pause_1_len_max)\r
{\r
- ANALYZE_PRINTF ("%8d [bit %2d: pulse = %3d, pause = %3d] ", time_counter, irmp_bit, irmp_pulse_time, irmp_pause_time);\r
+ ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_bit, irmp_pulse_time, irmp_pause_time);\r
\r
ANALYZE_PUTCHAR ((irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? '1' : '0');\r
ANALYZE_NEWLINE ();\r
else\r
#endif // IRMP_SUPPORT_MANCHESTER == 1\r
\r
+#if IRMP_SUPPORT_SERIAL == 1\r
+ if (irmp_param.flags & IRMP_PARAM_FLAG_IS_SERIAL)\r
+ {\r
+ ; // do nothing\r
+ }\r
+ else\r
+#endif // IRMP_SUPPORT_SERIAL == 1\r
+\r
+\r
#if IRMP_SUPPORT_DENON_PROTOCOL == 1\r
if (irmp_param.protocol == IRMP_DENON_PROTOCOL)\r
{\r
- ANALYZE_PRINTF ("%8d [bit %2d: pulse = %3d, pause = %3d] ", time_counter, irmp_bit, irmp_pulse_time, irmp_pause_time);\r
+ ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_bit, irmp_pulse_time, irmp_pause_time);\r
\r
if (irmp_pause_time >= DENON_1_PAUSE_LEN_MIN && irmp_pause_time <= DENON_1_PAUSE_LEN_MAX)\r
{ // pause timings correct for "1"?\r
}\r
else\r
#endif // IRMP_SUPPORT_DENON_PROTOCOL == 1\r
+#if IRMP_SUPPORT_THOMSON_PROTOCOL == 1\r
+ if (irmp_param.protocol == IRMP_THOMSON_PROTOCOL)\r
+ {\r
+ ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_bit, irmp_pulse_time, irmp_pause_time);\r
+\r
+ if (irmp_pause_time >= THOMSON_1_PAUSE_LEN_MIN && irmp_pause_time <= THOMSON_1_PAUSE_LEN_MAX)\r
+ { // pause timings correct for "1"?\r
+ ANALYZE_PUTCHAR ('1'); // yes, store 1\r
+ ANALYZE_NEWLINE ();\r
+ irmp_store_bit (1);\r
+ }\r
+ else // if (irmp_pause_time >= THOMSON_0_PAUSE_LEN_MIN && irmp_pause_time <= THOMSON_0_PAUSE_LEN_MAX)\r
+ { // pause timings correct for "0"?\r
+ ANALYZE_PUTCHAR ('0'); // yes, store 0\r
+ ANALYZE_NEWLINE ();\r
+ irmp_store_bit (0);\r
+ }\r
+ }\r
+ else\r
+#endif // IRMP_SUPPORT_THOMSON_PROTOCOL == 1\r
{\r
; // else do nothing\r
}\r
{ // yes...\r
if (irmp_bit == irmp_param.complete_len && irmp_param.stop_bit == 1)\r
{\r
- if (irmp_pulse_time >= irmp_param.pulse_0_len_min && irmp_pulse_time <= irmp_param.pulse_0_len_max)\r
+ if (\r
+#if IRMP_SUPPORT_MANCHESTER == 1\r
+ (irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER) ||\r
+#endif\r
+#if IRMP_SUPPORT_SERIAL == 1\r
+ (irmp_param.flags & IRMP_PARAM_FLAG_IS_SERIAL) ||\r
+#endif\r
+ (irmp_pulse_time >= irmp_param.pulse_0_len_min && irmp_pulse_time <= irmp_param.pulse_0_len_max))\r
{\r
#ifdef ANALYZE\r
if (! (irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER))\r
}\r
else\r
{\r
- ANALYZE_PRINTF ("stop bit timing wrong\n");\r
+ ANALYZE_PRINTF ("error: stop bit timing wrong, irmp_bit = %d, irmp_pulse_time = %d, pulse_0_len_min = %d, pulse_0_len_max = %d\n",\r
+ irmp_bit, irmp_pulse_time, irmp_param.pulse_0_len_min, irmp_param.pulse_0_len_max);\r
\r
+// irmp_busy_flag = FALSE;\r
irmp_start_bit_detected = 0; // wait for another start bit...\r
irmp_pulse_time = 0;\r
irmp_pause_time = 0;\r
}\r
else\r
#endif\r
-#if IRMP_SUPPORT_GRUNDIG_OR_NOKIA_PROTOCOL == 1\r
+#if IRMP_SUPPORT_SERIAL == 1\r
+ // NETBOX generates no stop bit, here is the timeout condition:\r
+ if ((irmp_param.flags & IRMP_PARAM_FLAG_IS_SERIAL) && irmp_param.protocol == IRMP_NETBOX_PROTOCOL &&\r
+ irmp_pause_time >= NETBOX_PULSE_LEN * (NETBOX_COMPLETE_DATA_LEN - irmp_bit))\r
+ {\r
+ got_light = TRUE; // this is a lie, but helps (generates stop bit)\r
+ }\r
+ else\r
+#endif\r
+#if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1\r
if (irmp_param.protocol == IRMP_GRUNDIG_PROTOCOL && !irmp_param.stop_bit)\r
{\r
- if (irmp_pause_time > 2 * irmp_param.pause_1_len_max && irmp_bit >= GRUNDIG_COMPLETE_DATA_LEN - 2)\r
+ if (irmp_pause_time > IR60_TIMEOUT_LEN && (irmp_bit == 5 || irmp_bit == 6))\r
+ {\r
+ ANALYZE_PRINTF ("Switching to IR60 protocol\n");\r
+ got_light = TRUE; // this is a lie, but generates a stop bit ;-)\r
+ irmp_param.stop_bit = TRUE; // set flag\r
+\r
+ irmp_param.protocol = IRMP_IR60_PROTOCOL; // change protocol\r
+ irmp_param.complete_len = IR60_COMPLETE_DATA_LEN; // correct complete len\r
+ irmp_param.address_offset = IR60_ADDRESS_OFFSET;\r
+ irmp_param.address_end = IR60_ADDRESS_OFFSET + IR60_ADDRESS_LEN;\r
+ irmp_param.command_offset = IR60_COMMAND_OFFSET;\r
+ irmp_param.command_end = IR60_COMMAND_OFFSET + IR60_COMMAND_LEN;\r
+\r
+ irmp_tmp_command <<= 1;\r
+ irmp_tmp_command |= first_bit;\r
+ }\r
+ else if (irmp_pause_time >= 2 * irmp_param.pause_1_len_max && irmp_bit >= GRUNDIG_COMPLETE_DATA_LEN - 2)\r
{ // special manchester decoder\r
irmp_param.complete_len = GRUNDIG_COMPLETE_DATA_LEN; // correct complete len\r
got_light = TRUE; // this is a lie, but generates a stop bit ;-)\r
}\r
else\r
#endif\r
+#if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1\r
+ if (irmp_param.protocol == IRMP_RUWIDO_PROTOCOL && !irmp_param.stop_bit)\r
+ {\r
+ if (irmp_pause_time >= 2 * irmp_param.pause_1_len_max && irmp_bit >= RUWIDO_COMPLETE_DATA_LEN - 2)\r
+ { // special manchester decoder\r
+ irmp_param.complete_len = RUWIDO_COMPLETE_DATA_LEN; // correct complete len\r
+ got_light = TRUE; // this is a lie, but generates a stop bit ;-)\r
+ irmp_param.stop_bit = TRUE; // set flag\r
+ }\r
+ else if (irmp_bit >= RUWIDO_COMPLETE_DATA_LEN)\r
+ {\r
+ ANALYZE_PRINTF ("Switching to SIEMENS protocol\n");\r
+ irmp_param.protocol = IRMP_SIEMENS_PROTOCOL; // change protocol\r
+ irmp_param.address_offset = SIEMENS_ADDRESS_OFFSET;\r
+ irmp_param.address_end = SIEMENS_ADDRESS_OFFSET + SIEMENS_ADDRESS_LEN;\r
+ irmp_param.command_offset = SIEMENS_COMMAND_OFFSET;\r
+ irmp_param.command_end = SIEMENS_COMMAND_OFFSET + SIEMENS_COMMAND_LEN;\r
+\r
+ // 76543210\r
+ // RUWIDO: AAAAAAAAACCCCCCCp\r
+ // SIEMENS: AAAAAAAAAAACCCCCCCCCCp\r
+ irmp_tmp_address <<= 2;\r
+ irmp_tmp_address |= (irmp_tmp_command >> 6);\r
+ irmp_tmp_command &= 0x003F;\r
+ irmp_tmp_command <<= 4;\r
+ irmp_tmp_command |= last_value;\r
+ }\r
+ }\r
+ else\r
+#endif\r
#if IRMP_SUPPORT_MANCHESTER == 1\r
if ((irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER) &&\r
- irmp_pause_time > 2 * irmp_param.pause_1_len_max && irmp_bit >= irmp_param.complete_len - 2 && !irmp_param.stop_bit)\r
+ irmp_pause_time >= 2 * irmp_param.pause_1_len_max && irmp_bit >= irmp_param.complete_len - 2 && !irmp_param.stop_bit)\r
{ // special manchester decoder\r
got_light = TRUE; // this is a lie, but generates a stop bit ;-)\r
irmp_param.stop_bit = TRUE; // set flag\r
#if IRMP_SUPPORT_JVC_PROTOCOL == 1\r
else if (irmp_param.protocol == IRMP_NEC_PROTOCOL && (irmp_bit == 16 || irmp_bit == 17)) // it was a JVC stop bit\r
{\r
- ANALYZE_PRINTF ("Switching to JVC protocol\n");\r
+ ANALYZE_PRINTF ("Switching to JVC protocol, irmp_bit = %d\n", irmp_bit);\r
irmp_param.stop_bit = TRUE; // set flag\r
irmp_param.protocol = IRMP_JVC_PROTOCOL; // switch protocol\r
irmp_param.complete_len = irmp_bit; // patch length: 16 or 17\r
irmp_start_bit_detected = 1; // tricky: don't wait for another start bit...\r
}\r
#endif // IRMP_SUPPORT_JVC_PROTOCOL == 1\r
+\r
+#if IRMP_SUPPORT_NEC42_PROTOCOL == 1\r
+#if IRMP_SUPPORT_NEC_PROTOCOL == 1\r
+ else if (irmp_param.protocol == IRMP_NEC42_PROTOCOL && irmp_bit == 32) // it was a NEC stop bit\r
+ {\r
+ ANALYZE_PRINTF ("Switching to NEC protocol\n");\r
+ irmp_param.stop_bit = TRUE; // set flag\r
+ irmp_param.protocol = IRMP_NEC_PROTOCOL; // switch protocol\r
+ irmp_param.complete_len = irmp_bit; // patch length: 16 or 17\r
+\r
+ // 0123456789ABC0123456789ABC0123456701234567\r
+ // NEC42: AAAAAAAAAAAAAaaaaaaaaaaaaaCCCCCCCCcccccccc\r
+ // NEC: AAAAAAAAaaaaaaaaCCCCCCCCcccccccc\r
+ irmp_tmp_address |= (irmp_tmp_address2 & 0x0007) << 13; // fm 2012-02-13: 12 -> 13\r
+ irmp_tmp_command = (irmp_tmp_address2 >> 3) | (irmp_tmp_command << 10);\r
+ }\r
+#endif // IRMP_SUPPORT_NEC_PROTOCOL == 1\r
+#if IRMP_SUPPORT_JVC_PROTOCOL == 1\r
+ else if (irmp_param.protocol == IRMP_NEC42_PROTOCOL && (irmp_bit == 16 || irmp_bit == 17)) // it was a JVC stop bit\r
+ {\r
+ ANALYZE_PRINTF ("Switching to JVC protocol, irmp_bit = %d\n", irmp_bit);\r
+ irmp_param.stop_bit = TRUE; // set flag\r
+ irmp_param.protocol = IRMP_JVC_PROTOCOL; // switch protocol\r
+ irmp_param.complete_len = irmp_bit; // patch length: 16 or 17\r
+\r
+ // 0123456789ABC0123456789ABC0123456701234567\r
+ // NEC42: AAAAAAAAAAAAAaaaaaaaaaaaaaCCCCCCCCcccccccc\r
+ // JVC: AAAACCCCCCCCCCCC\r
+ irmp_tmp_command = (irmp_tmp_address >> 4) | (irmp_tmp_address2 << 9); // set command: upper 12 bits are command bits\r
+ irmp_tmp_address = irmp_tmp_address & 0x000F; // lower 4 bits are address bits\r
+ }\r
+#endif // IRMP_SUPPORT_JVC_PROTOCOL == 1\r
+#endif // IRMP_SUPPORT_NEC42_PROTOCOL == 1\r
else\r
{\r
ANALYZE_PRINTF ("error 2: pause %d after data bit %d too long\n", irmp_pause_time, irmp_bit);\r
ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');\r
\r
+// irmp_busy_flag = FALSE;\r
irmp_start_bit_detected = 0; // wait for another start bit...\r
irmp_pulse_time = 0;\r
irmp_pause_time = 0;\r
\r
if (got_light)\r
{\r
- ANALYZE_PRINTF ("%8d [bit %2d: pulse = %3d, pause = %3d] ", time_counter, irmp_bit, irmp_pulse_time, irmp_pause_time);\r
+ ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_bit, irmp_pulse_time, irmp_pause_time);\r
\r
#if IRMP_SUPPORT_MANCHESTER == 1\r
if ((irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER)) // Manchester\r
{\r
+#if 1\r
if (irmp_pulse_time > irmp_param.pulse_1_len_max /* && irmp_pulse_time <= 2 * irmp_param.pulse_1_len_max */)\r
+#else // better, but some IR-RCs use asymmetric timings :-/\r
+ if (irmp_pulse_time > irmp_param.pulse_1_len_max && irmp_pulse_time <= 2 * irmp_param.pulse_1_len_max &&\r
+ irmp_pause_time <= 2 * irmp_param.pause_1_len_max)\r
+#endif\r
{\r
#if IRMP_SUPPORT_RC6_PROTOCOL == 1\r
if (irmp_param.protocol == IRMP_RC6_PROTOCOL && irmp_bit == 4 && irmp_pulse_time > RC6_TOGGLE_BIT_LEN_MIN) // RC6 toggle bit\r
}\r
}\r
}\r
- else if (irmp_pulse_time >= irmp_param.pulse_1_len_min && irmp_pulse_time <= irmp_param.pulse_1_len_max)\r
+ else if (irmp_pulse_time >= irmp_param.pulse_1_len_min && irmp_pulse_time <= irmp_param.pulse_1_len_max\r
+ /* && irmp_pause_time <= 2 * irmp_param.pause_1_len_max */)\r
{\r
uint8_t manchester_value;\r
\r
ANALYZE_NEWLINE ();\r
ANALYZE_PRINTF ("error 3 manchester: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit, irmp_pulse_time, irmp_pause_time);\r
ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');\r
+// irmp_busy_flag = FALSE;\r
irmp_start_bit_detected = 0; // reset flags and wait for next start bit\r
irmp_pause_time = 0;\r
}\r
else\r
#endif // IRMP_SUPPORT_MANCHESTER == 1\r
\r
+#if IRMP_SUPPORT_SERIAL == 1\r
+ if (irmp_param.flags & IRMP_PARAM_FLAG_IS_SERIAL)\r
+ {\r
+ while (irmp_bit < irmp_param.complete_len && irmp_pulse_time > irmp_param.pulse_1_len_max)\r
+ {\r
+ ANALYZE_PUTCHAR ('1');\r
+ irmp_store_bit (1);\r
+\r
+ if (irmp_pulse_time >= irmp_param.pulse_1_len_min)\r
+ {\r
+ irmp_pulse_time -= irmp_param.pulse_1_len_min;\r
+ }\r
+ else\r
+ {\r
+ irmp_pulse_time = 0;\r
+ }\r
+ }\r
+\r
+ while (irmp_bit < irmp_param.complete_len && irmp_pause_time > irmp_param.pause_1_len_max)\r
+ {\r
+ ANALYZE_PUTCHAR ('0');\r
+ irmp_store_bit (0);\r
+\r
+ if (irmp_pause_time >= irmp_param.pause_1_len_min)\r
+ {\r
+ irmp_pause_time -= irmp_param.pause_1_len_min;\r
+ }\r
+ else\r
+ {\r
+ irmp_pause_time = 0;\r
+ }\r
+ }\r
+ ANALYZE_NEWLINE ();\r
+ wait_for_space = 0;\r
+ }\r
+ else\r
+#endif // IRMP_SUPPORT_SERIAL == 1\r
\r
#if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1\r
if (irmp_param.protocol == IRMP_SAMSUNG_PROTOCOL && irmp_bit == 16) // Samsung: 16th bit\r
{ // timing incorrect!\r
ANALYZE_PRINTF ("error 3 Samsung: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit, irmp_pulse_time, irmp_pause_time);\r
ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');\r
+// irmp_busy_flag = FALSE;\r
irmp_start_bit_detected = 0; // reset flags and wait for next start bit\r
irmp_pause_time = 0;\r
}\r
else\r
#endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL\r
\r
+#if IRMP_SUPPORT_NEC16_PROTOCOL\r
+#if IRMP_SUPPORT_NEC42_PROTOCOL == 1\r
+ if (irmp_param.protocol == IRMP_NEC42_PROTOCOL &&\r
+#else // IRMP_SUPPORT_NEC_PROTOCOL instead\r
+ if (irmp_param.protocol == IRMP_NEC_PROTOCOL &&\r
+#endif // IRMP_SUPPORT_NEC42_PROTOCOL == 1\r
+ irmp_bit == 8 && irmp_pause_time >= NEC_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= NEC_START_BIT_PAUSE_LEN_MAX)\r
+ {\r
+ ANALYZE_PRINTF ("Switching to NEC16 protocol\n");\r
+ irmp_param.protocol = IRMP_NEC16_PROTOCOL;\r
+ irmp_param.address_offset = NEC16_ADDRESS_OFFSET;\r
+ irmp_param.address_end = NEC16_ADDRESS_OFFSET + NEC16_ADDRESS_LEN;\r
+ irmp_param.command_offset = NEC16_COMMAND_OFFSET;\r
+ irmp_param.command_end = NEC16_COMMAND_OFFSET + NEC16_COMMAND_LEN;\r
+ irmp_param.complete_len = NEC16_COMPLETE_DATA_LEN;\r
+ wait_for_space = 0;\r
+ }\r
+ else\r
+#endif // IRMP_SUPPORT_NEC16_PROTOCOL\r
+\r
#if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1\r
if (irmp_param.protocol == IRMP_BANG_OLUFSEN_PROTOCOL)\r
{\r
{ // timing incorrect!\r
ANALYZE_PRINTF ("error 3a B&O: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit, irmp_pulse_time, irmp_pause_time);\r
ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');\r
+// irmp_busy_flag = FALSE;\r
irmp_start_bit_detected = 0; // reset flags and wait for next start bit\r
irmp_pause_time = 0;\r
}\r
{ // timing incorrect!\r
ANALYZE_PRINTF ("error 3b B&O: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit, irmp_pulse_time, irmp_pause_time);\r
ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');\r
+// irmp_busy_flag = FALSE;\r
irmp_start_bit_detected = 0; // reset flags and wait for next start bit\r
irmp_pause_time = 0;\r
}\r
{ // timing incorrect!\r
ANALYZE_PRINTF ("error 3c B&O: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit, irmp_pulse_time, irmp_pause_time);\r
ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');\r
+// irmp_busy_flag = FALSE;\r
irmp_start_bit_detected = 0; // reset flags and wait for next start bit\r
irmp_pause_time = 0;\r
}\r
{ // timing incorrect!\r
ANALYZE_PRINTF ("error 3d B&O: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit, irmp_pulse_time, irmp_pause_time);\r
ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');\r
+// irmp_busy_flag = FALSE;\r
irmp_start_bit_detected = 0; // reset flags and wait for next start bit\r
irmp_pause_time = 0;\r
}\r
wait_for_space = 0;\r
}\r
else\r
+#if IRMP_SUPPORT_KATHREIN_PROTOCOL\r
+\r
+ if (irmp_param.protocol == IRMP_KATHREIN_PROTOCOL &&\r
+ irmp_pulse_time >= KATHREIN_1_PULSE_LEN_MIN && irmp_pulse_time <= KATHREIN_1_PULSE_LEN_MAX &&\r
+ (((irmp_bit == 8 || irmp_bit == 6) &&\r
+ irmp_pause_time >= KATHREIN_SYNC_BIT_PAUSE_LEN_MIN && irmp_pause_time <= KATHREIN_SYNC_BIT_PAUSE_LEN_MAX) ||\r
+ (irmp_bit == 12 &&\r
+ irmp_pause_time >= KATHREIN_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= KATHREIN_START_BIT_PAUSE_LEN_MAX)))\r
+\r
+ {\r
+ if (irmp_bit == 8)\r
+ {\r
+ irmp_bit++;\r
+ ANALYZE_PUTCHAR ('S');\r
+ ANALYZE_NEWLINE ();\r
+ irmp_tmp_command <<= 1;\r
+ }\r
+ else\r
+ {\r
+ ANALYZE_PUTCHAR ('S');\r
+ ANALYZE_NEWLINE ();\r
+ irmp_store_bit (1);\r
+ }\r
+ wait_for_space = 0;\r
+ }\r
+ else\r
+#endif // IRMP_SUPPORT_KATHREIN_PROTOCOL\r
{ // timing incorrect!\r
ANALYZE_PRINTF ("error 3: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit, irmp_pulse_time, irmp_pause_time);\r
ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');\r
+// irmp_busy_flag = FALSE;\r
irmp_start_bit_detected = 0; // reset flags and wait for next start bit\r
irmp_pause_time = 0;\r
}\r
#endif\r
\r
{\r
- ANALYZE_PRINTF ("%8d code detected, length = %d\n", time_counter, irmp_bit);\r
+ ANALYZE_PRINTF ("%8.3fms code detected, length = %d\n", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_bit);\r
irmp_ir_detected = TRUE;\r
\r
#if IRMP_SUPPORT_DENON_PROTOCOL == 1\r
if ((~irmp_tmp_command & 0x3FF) == last_irmp_denon_command) // command bits must be inverted\r
{\r
irmp_tmp_command = last_irmp_denon_command; // use command received before!\r
+ last_irmp_denon_command = 0;\r
\r
irmp_protocol = irmp_param.protocol; // store protocol\r
irmp_address = irmp_tmp_address; // store address\r
}\r
else\r
{\r
- ANALYZE_PRINTF ("waiting for inverted command repetition\n");\r
+ ANALYZE_PRINTF ("%8.3fms waiting for inverted command repetition\n", (double) (time_counter * 1000) / F_INTERRUPTS);\r
irmp_ir_detected = FALSE;\r
last_irmp_denon_command = irmp_tmp_command;\r
+ repetition_len = 0;\r
}\r
}\r
else\r
\r
if (xor != xor_check[5])\r
{\r
- ANALYZE_PRINTF ("error 4: wrong XOR check for data bits: 0x%02x 0x%02x\n", xor, xor_check[5]);\r
+ ANALYZE_PRINTF ("error 5: wrong XOR check for data bits: 0x%02x 0x%02x\n", xor, xor_check[5]);\r
irmp_ir_detected = FALSE;\r
}\r
+\r
+ irmp_flags |= genre2; // write the genre2 bits into MSB of the flag byte\r
}\r
#endif // IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1\r
\r
\r
irmp_address = irmp_tmp_address; // store address\r
#if IRMP_SUPPORT_NEC_PROTOCOL == 1\r
- last_irmp_address = irmp_tmp_address; // store as last address, too\r
+ if (irmp_param.protocol == IRMP_NEC_PROTOCOL)\r
+ {\r
+ last_irmp_address = irmp_tmp_address; // store as last address, too\r
+ }\r
#endif\r
\r
#if IRMP_SUPPORT_RC5_PROTOCOL == 1\r
\r
if (irmp_ir_detected)\r
{\r
- if (last_irmp_command == irmp_command &&\r
- last_irmp_address == irmp_address &&\r
+ if (last_irmp_command == irmp_tmp_command &&\r
+ last_irmp_address == irmp_tmp_address &&\r
repetition_len < IRMP_KEY_REPETITION_LEN)\r
{\r
irmp_flags |= IRMP_FLAG_REPETITION;\r
ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');\r
}\r
\r
+// irmp_busy_flag = FALSE;\r
irmp_start_bit_detected = 0; // and wait for next start bit\r
irmp_tmp_command = 0;\r
irmp_pulse_time = 0;\r
DENON_PULSE_LEN_MIN, DENON_PULSE_LEN_MAX, DENON_0_PAUSE_LEN_MIN, DENON_0_PAUSE_LEN_MAX,\r
DENON_PULSE_LEN_MIN, DENON_PULSE_LEN_MAX, DENON_1_PAUSE_LEN_MIN, DENON_1_PAUSE_LEN_MAX);\r
\r
+ printf ("THOMSON 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",\r
+ THOMSON_PULSE_LEN_MIN, THOMSON_PULSE_LEN_MAX,\r
+ THOMSON_PULSE_LEN_MIN, THOMSON_PULSE_LEN_MAX, THOMSON_0_PAUSE_LEN_MIN, THOMSON_0_PAUSE_LEN_MAX,\r
+ THOMSON_PULSE_LEN_MIN, THOMSON_PULSE_LEN_MAX, THOMSON_1_PAUSE_LEN_MIN, THOMSON_1_PAUSE_LEN_MAX);\r
+\r
printf ("RC6 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",\r
RC6_START_BIT_PULSE_LEN_MIN, RC6_START_BIT_PULSE_LEN_MAX, RC6_START_BIT_PAUSE_LEN_MIN, RC6_START_BIT_PAUSE_LEN_MAX,\r
RC6_BIT_PULSE_LEN_MIN, RC6_BIT_PULSE_LEN_MAX, RC6_BIT_PAUSE_LEN_MIN, RC6_BIT_PAUSE_LEN_MAX);\r
BANG_OLUFSEN_PULSE_LEN_MIN, BANG_OLUFSEN_PULSE_LEN_MAX, BANG_OLUFSEN_1_PAUSE_LEN_MIN, BANG_OLUFSEN_1_PAUSE_LEN_MAX);\r
\r
printf ("GRUNDIG/NOKIA 1 %3d - %3d %3d - %3d %3d - %3d\n",\r
- GRUNDIG_OR_NOKIA_START_BIT_LEN_MIN, GRUNDIG_OR_NOKIA_START_BIT_LEN_MAX, GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN_MIN, GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN_MAX,\r
- GRUNDIG_OR_NOKIA_BIT_LEN_MIN, GRUNDIG_OR_NOKIA_BIT_LEN_MAX);\r
-\r
- printf ("SIEMENS 1 %3d - %3d %3d - %3d %3d - %3d\n",\r
- SIEMENS_START_BIT_LEN_MIN, SIEMENS_START_BIT_LEN_MAX, SIEMENS_START_BIT_LEN_MIN, SIEMENS_START_BIT_LEN_MAX,\r
- SIEMENS_BIT_LEN_MIN, SIEMENS_BIT_LEN_MAX);\r
+ GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN, GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX,\r
+ GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN, GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX,\r
+ GRUNDIG_NOKIA_IR60_BIT_LEN_MIN, GRUNDIG_NOKIA_IR60_BIT_LEN_MAX);\r
+\r
+ printf ("SIEMENS/RUWIDO 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",\r
+ SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN, SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX,\r
+ SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN, SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX,\r
+ SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN, SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX,\r
+ SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN, SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX,\r
+ 2 * SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN, 2 * SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX,\r
+ 2 * SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN, 2 * SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX);\r
\r
printf ("FDC 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",\r
FDC_START_BIT_PULSE_LEN_MIN, FDC_START_BIT_PULSE_LEN_MAX, FDC_START_BIT_PAUSE_LEN_MIN, FDC_START_BIT_PAUSE_LEN_MAX,\r
NIKON_PULSE_LEN_MIN, NIKON_PULSE_LEN_MAX, NIKON_0_PAUSE_LEN_MIN, NIKON_0_PAUSE_LEN_MAX,\r
NIKON_PULSE_LEN_MIN, NIKON_PULSE_LEN_MAX, NIKON_1_PAUSE_LEN_MIN, NIKON_1_PAUSE_LEN_MAX);\r
\r
+ printf ("LEGO 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",\r
+ LEGO_START_BIT_PULSE_LEN_MIN, LEGO_START_BIT_PULSE_LEN_MAX, LEGO_START_BIT_PAUSE_LEN_MIN, LEGO_START_BIT_PAUSE_LEN_MAX,\r
+ LEGO_PULSE_LEN_MIN, LEGO_PULSE_LEN_MAX, LEGO_0_PAUSE_LEN_MIN, LEGO_0_PAUSE_LEN_MAX,\r
+ LEGO_PULSE_LEN_MIN, LEGO_PULSE_LEN_MAX, LEGO_1_PAUSE_LEN_MIN, LEGO_1_PAUSE_LEN_MAX);\r
+\r
}\r
\r
void\r
}\r
}\r
\r
- for (i = 0; i < 100; i++)\r
+ for (i = 1; i < 100; i++)\r
{\r
if (buf[i] > 0)\r
{\r
case 0x000C: key = '\\'; break;\r
case 0x001C: key = '~'; break;\r
case 0x002D: key = '|'; break;\r
- case 0x0034: key = 'µ'; break;\r
+ case 0x0034: key = 0xB5; break; // Mu\r
}\r
}\r
else if (state & (STATE_LEFT_CTRL))\r
\r
if (verbose)\r
{\r
- printf ("%8d ", time_counter);\r
+ printf ("%8.3fms ", (double) (time_counter * 1000) / F_INTERRUPTS);\r
}\r
\r
if (irmp_data.protocol == IRMP_FDC_PROTOCOL && (key = get_fdc_key (irmp_data.command)) != 0)\r
\r
if (! analyze)\r
{\r
- for (i = 0; i < (int) ((8000.0 * F_INTERRUPTS) / 10000); i++) // newline: long pause of 800 msec\r
+ for (i = 0; i < (int) ((10000.0 * F_INTERRUPTS) / 10000); i++) // newline: long pause of 10000 msec\r
{\r
next_tick ();\r
}\r