From 3d2da98a7a2b423edbdf4e685b588fbc5789dd7f Mon Sep 17 00:00:00 2001 From: ukw Date: Mon, 21 Sep 2015 12:46:25 +0000 Subject: [PATCH] Version 2.9.5: added TECHNICS protocol git-svn-id: svn://mikrocontroller.net/irmp@164 aeb2e35e-bfc4-4214-b83c-9e8de998ed28 --- IR-Data/test-suite.sh | 57 +++++++++++++++++++++++-------------------- README.txt | 4 +-- irmp.c | 45 +++++++++++++++++++++++++++++++++- irmp.h | 9 +++++-- irmpconfig.h | 3 ++- irmpprotocols.h | 15 +++++++++--- irsnd.c | 37 ++++++++++++++++++++++++++-- irsndconfig.h | 3 ++- 8 files changed, 134 insertions(+), 39 deletions(-) diff --git a/IR-Data/test-suite.sh b/IR-Data/test-suite.sh index 3ea37ca..b0ffbb2 100644 --- a/IR-Data/test-suite.sh +++ b/IR-Data/test-suite.sh @@ -72,16 +72,16 @@ do echo -n "testing $j ... " if tmpsrc/irmp-10kHz -v < $j | grep -q error then - tmpsrc/irmp-10kHz -v < $j | grep error - echo "test failed" - exit 1 + tmpsrc/irmp-10kHz -v < $j | grep error + echo "test failed" + exit 1 else - if tmpsrc/irmp-10kHz -v < $j | grep -q checked - then - echo "checked!" - else - echo "successful" - fi + if tmpsrc/irmp-10kHz -v < $j | grep -q checked + then + echo "checked!" + else + echo "successful" + fi fi done @@ -99,29 +99,32 @@ for j in \ kathrein-15kHz.txt \ lg-air-15kHz.txt \ merlin-15kHz.txt \ + pentax-15kHz.txt \ recs80-15kHz.txt \ saa3004-15kHz.txt \ samsung32-15kHz.txt \ samsung48-15kHz.txt \ sharp_15khz.txt \ + technics-15kHz.txt \ thomson-mb100-15kHz.txt \ tp400vt-15kHz.txt \ universal-15kHz.txt \ + vincent-flash-15kHz.txt \ xbox360-15kHz.txt do echo -n "testing $j ... " if tmpsrc/irmp-15kHz -v < $j | grep -q error then - tmpsrc/irmp-15kHz -v < $j | grep error - echo "test failed" - exit 1 + tmpsrc/irmp-15kHz -v < $j | grep error + echo "test failed" + exit 1 else - if tmpsrc/irmp-15kHz -v < $j | grep -q checked - then - echo "checked!" - else - echo "successful" - fi + if tmpsrc/irmp-15kHz -v < $j | grep -q checked + then + echo "checked!" + else + echo "successful" + fi fi done @@ -138,16 +141,16 @@ do echo -n "testing $j ... " if tmpsrc/irmp-20kHz -v < $j | grep -q error then - tmpsrc/irmp-20kHz -v < $j | grep error - echo "test failed" - exit 1 + tmpsrc/irmp-20kHz -v < $j | grep error + echo "test failed" + exit 1 else - if tmpsrc/irmp-20kHz -v < $j | grep -q checked - then - echo "checked!" - else - echo "successful" - fi + if tmpsrc/irmp-20kHz -v < $j | grep -q checked + then + echo "checked!" + else + echo "successful" + fi fi done diff --git a/README.txt b/README.txt index cd9262f..b834656 100644 --- a/README.txt +++ b/README.txt @@ -1,8 +1,8 @@ IRMP - Infrared Multi Protocol Decoder -------------------------------------- -Version IRMP: 2.9.4 15.06.2015 -Version IRSND: 2.9.4 15.06.2015 +Version IRMP: 2.9.5 20.06.2015 +Version IRSND: 2.9.5 20.06.2015 Dokumentation: diff --git a/irmp.c b/irmp.c index 9c39436..8bf45dc 100644 --- a/irmp.c +++ b/irmp.c @@ -3,7 +3,7 @@ * * Copyright (c) 2009-2015 Frank Meyer - frank(at)fli4l.de * - * $Id: irmp.c,v 1.176 2015/06/15 10:30:08 fm Exp $ + * $Id: irmp.c,v 1.177 2015/09/19 15:28:31 fm Exp $ * * Supported AVR mikrocontrollers: * @@ -604,6 +604,7 @@ static const char proto_pentax[] PROGMEM = "PENTAX"; static const char proto_fan[] PROGMEM = "FAN"; static const char proto_s100[] PROGMEM = "S100"; static const char proto_acp24[] PROGMEM = "ACP24"; +static const char proto_technics[] PROGMEM = "TECHNICS"; static const char proto_radio1[] PROGMEM = "RADIO1"; @@ -657,6 +658,7 @@ irmp_protocol_names[IRMP_N_PROTOCOLS + 1] PROGMEM = proto_fan, proto_s100, proto_acp24, + proto_technics, proto_radio1 }; @@ -3789,6 +3791,47 @@ irmp_ISR (void) irmp_param.complete_len = irmp_bit; // patch length } #endif // IRMP_SUPPORT_RCMM_PROTOCOL == 1 + +#if IRMP_SUPPORT_TECHNICS_PROTOCOL == 1 + else if (irmp_param.protocol == IRMP_MATSUSHITA_PROTOCOL && irmp_bit == 22) // it was a TECHNICS stop bit + { +#ifdef ANALYZE + ANALYZE_PRINTF ("Switching to TECHNICS protocol, irmp_bit = %d\n", irmp_bit); +#endif // ANALYZE + // Situation: + // The first 12 bits have been stored in irmp_tmp_command (LSB first) + // The following 10 bits have been stored in irmp_tmp_address (LSB first) + // The code of TECHNICS is: + // cccccccccccCCCCCCCCCCC (11 times c and 11 times C) + // ccccccccccccaaaaaaaaaa + // where C is inverted value of c + + irmp_tmp_address <<= 1; + if (irmp_tmp_command & (1<<11)) + { + irmp_tmp_address |= 1; + irmp_tmp_command &= ~(1<<11); + } + + if (irmp_tmp_command == ((~irmp_tmp_address) & 0x07FF)) + { + irmp_tmp_address = 0; + + irmp_param.protocol = IRMP_TECHNICS_PROTOCOL; // switch protocol + irmp_param.complete_len = irmp_bit; // patch length + } + else + { +#ifdef ANALYZE + ANALYZE_PRINTF ("error 8: TECHNICS frame error\n"); + ANALYZE_ONLY_NORMAL_PUTCHAR ('\n'); +#endif // ANALYZE + irmp_start_bit_detected = 0; // wait for another start bit... + irmp_pulse_time = 0; + irmp_pause_time = 0; + } + } +#endif // IRMP_SUPPORT_TECHNICS_PROTOCOL == 1 else { #ifdef ANALYZE diff --git a/irmp.h b/irmp.h index 232f531..76346ce 100644 --- a/irmp.h +++ b/irmp.h @@ -3,7 +3,7 @@ * * Copyright (c) 2009-2015 Frank Meyer - frank(at)fli4l.de * - * $Id: irmp.h,v 1.96 2015/06/15 10:30:09 fm Exp $ + * $Id: irmp.h,v 1.97 2015/09/19 15:28:31 fm Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -75,6 +75,11 @@ #endif +#if IRMP_SUPPORT_TECHNICS_PROTOCOL == 1 +# undef IRMP_SUPPORT_MATSUSHITA_PROTOCOL +# define IRMP_SUPPORT_MATSUSHITA_PROTOCOL 1 +#endif + #if IRMP_SUPPORT_DENON_PROTOCOL == 1 && IRMP_SUPPORT_RUWIDO_PROTOCOL == 1 # warning DENON protocol conflicts wih RUWIDO, please enable only one of both protocols # warning RUWIDO protocol disabled @@ -86,7 +91,7 @@ # warning DENON protocol conflicts wih ACP24, please enable only one of both protocols # warning ACP24 protocol disabled # undef IRMP_SUPPORT_ACP24_PROTOCOL -# define IRMP_SUPPORT_ACP24_PROTOCOL 0 +# define IRMP_SUPPORT_ACP24_PROTOCOL 0 #endif #if IRMP_SUPPORT_RC6_PROTOCOL == 1 && IRMP_SUPPORT_ROOMBA_PROTOCOL == 1 diff --git a/irmpconfig.h b/irmpconfig.h index 3bf9c60..5c18ddd 100644 --- a/irmpconfig.h +++ b/irmpconfig.h @@ -6,7 +6,7 @@ * Copyright (c) 2009-2015 Frank Meyer - frank(at)fli4l.de * Extensions for PIC 12F1820 W.Strobl 2014-07-20 * - * $Id: irmpconfig.h,v 1.134 2015/06/15 11:40:54 fm Exp $ + * $Id: irmpconfig.h,v 1.136 2015/09/21 12:44:16 fm Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -95,6 +95,7 @@ #define IRMP_SUPPORT_PENTAX_PROTOCOL 0 // Pentax >= 10000 ~150 bytes #define IRMP_SUPPORT_S100_PROTOCOL 0 // S100 >= 10000 ~250 bytes #define IRMP_SUPPORT_ACP24_PROTOCOL 0 // ACP24 >= 10000 ~250 bytes +#define IRMP_SUPPORT_TECHNICS_PROTOCOL 0 // TECHNICS >= 10000 ~250 bytes #define IRMP_SUPPORT_RADIO1_PROTOCOL 0 // RADIO, e.g. TEVION >= 10000 ~250 bytes (experimental) /*--------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/irmpprotocols.h b/irmpprotocols.h index d119d6c..127268d 100644 --- a/irmpprotocols.h +++ b/irmpprotocols.h @@ -5,7 +5,7 @@ * * Copyright (c) 2013-2015 Frank Meyer - frank(at)fli4l.de * - * $Id: irmpprotocols.h,v 1.36 2015/06/15 10:30:10 fm Exp $ + * $Id: irmpprotocols.h,v 1.38 2015/09/20 10:51:37 fm Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -71,9 +71,10 @@ #define IRMP_FAN_PROTOCOL 44 // FAN (ventilator), very similar to NUBERT, but last bit is data bit instead of stop bit #define IRMP_S100_PROTOCOL 45 // very similar to RC5, but 14 instead of 13 data bits #define IRMP_ACP24_PROTOCOL 46 // Stiebel Eltron ACP24 air conditioner -#define IRMP_RADIO1_PROTOCOL 47 // Radio protocol (experimental status), do not use it yet! +#define IRMP_TECHNICS_PROTOCOL 47 // Technics, similar to Matsushita, but 22 instead of 24 bits +#define IRMP_RADIO1_PROTOCOL 48 // Radio protocol (experimental status), do not use it yet! -#define IRMP_N_PROTOCOLS 47 // number of supported protocols +#define IRMP_N_PROTOCOLS 48 // number of supported protocols /*--------------------------------------------------------------------------------------------------------------------------------------------------- * timing constants: @@ -221,6 +222,14 @@ typedef uint8_t PAUSE_LEN; #define MATSUSHITA_LSB 1 // LSB...MSB? #define MATSUSHITA_FLAGS 0 // flags +/*--------------------------------------------------------------------------------------------------------------------------------------------------- + * TECHNICS: same timings as MATSUSHITA + *--------------------------------------------------------------------------------------------------------------------------------------------------- + */ +#define TECHNICS_ADDRESS_LEN 0 // read 0 address bits +#define TECHNICS_COMMAND_LEN 11 // read 11 bits +#define TECHNICS_COMPLETE_DATA_LEN 22 // complete length + /*--------------------------------------------------------------------------------------------------------------------------------------------------- * KASEIKYO: *--------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/irsnd.c b/irsnd.c index 5ca85a1..8420675 100644 --- a/irsnd.c +++ b/irsnd.c @@ -13,7 +13,7 @@ * ATmega164, ATmega324, ATmega644, ATmega644P, ATmega1284, ATmega1284P * ATmega88, ATmega88P, ATmega168, ATmega168P, ATmega328P * - * $Id: irsnd.c,v 1.90 2015/06/15 10:30:11 fm Exp $ + * $Id: irsnd.c,v 1.91 2015/09/20 10:51:37 fm Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1054,6 +1054,18 @@ irsnd_send_data (IRMP_DATA * irmp_data_p, uint8_t do_wait) break; } #endif +#if IRSND_SUPPORT_TECHNICS_PROTOCOL == 1 + case IRMP_TECHNICS_PROTOCOL: + { + command = bitsrevervse (irmp_data_p->command, TECHNICS_COMMAND_LEN); + + irsnd_buffer[0] = (command & 0x07FC) >> 3; // CCCCCCCC + irsnd_buffer[1] = ((command & 0x0007) << 5) | ((~command & 0x07C0) >> 6); // CCCccccc + irsnd_buffer[2] = (~command & 0x003F) << 2; // cccccc + irsnd_busy = TRUE; + break; + } +#endif #if IRSND_SUPPORT_KASEIKYO_PROTOCOL == 1 case IRMP_KASEIKYO_PROTOCOL: { @@ -1755,6 +1767,24 @@ irsnd_ISR (void) break; } #endif +#if IRSND_SUPPORT_TECHNICS_PROTOCOL == 1 + case IRMP_TECHNICS_PROTOCOL: + { + startbit_pulse_len = MATSUSHITA_START_BIT_PULSE_LEN; + startbit_pause_len = MATSUSHITA_START_BIT_PAUSE_LEN - 1; + pulse_1_len = MATSUSHITA_PULSE_LEN; + pause_1_len = MATSUSHITA_1_PAUSE_LEN - 1; + pulse_0_len = MATSUSHITA_PULSE_LEN; + pause_0_len = MATSUSHITA_0_PAUSE_LEN - 1; + has_stop_bit = MATSUSHITA_STOP_BIT; + complete_data_len = TECHNICS_COMPLETE_DATA_LEN; // here TECHNICS + n_auto_repetitions = 1; // 1 frame + auto_repetition_pause_len = 0; + repeat_frame_pause_len = MATSUSHITA_FRAME_REPEAT_PAUSE_LEN; + irsnd_set_freq (IRSND_FREQ_36_KHZ); + break; + } +#endif #if IRSND_SUPPORT_KASEIKYO_PROTOCOL == 1 case IRMP_KASEIKYO_PROTOCOL: { @@ -2269,6 +2299,9 @@ irsnd_ISR (void) #if IRSND_SUPPORT_MATSUSHITA_PROTOCOL == 1 case IRMP_MATSUSHITA_PROTOCOL: #endif +#if IRSND_SUPPORT_MATSUSHITA_PROTOCOL == 1 + case IRMP_TECHNICS_PROTOCOL: +#endif #if IRSND_SUPPORT_KASEIKYO_PROTOCOL == 1 case IRMP_KASEIKYO_PROTOCOL: #endif @@ -2325,7 +2358,7 @@ irsnd_ISR (void) #endif #if IRSND_SUPPORT_SIRCS_PROTOCOL == 1 || IRSND_SUPPORT_NEC_PROTOCOL == 1 || IRSND_SUPPORT_NEC16_PROTOCOL == 1 || IRSND_SUPPORT_NEC42_PROTOCOL == 1 || \ - IRSND_SUPPORT_LGAIR_PROTOCOL == 1 || IRSND_SUPPORT_SAMSUNG_PROTOCOL == 1 || IRSND_SUPPORT_MATSUSHITA_PROTOCOL == 1 || \ + IRSND_SUPPORT_LGAIR_PROTOCOL == 1 || IRSND_SUPPORT_SAMSUNG_PROTOCOL == 1 || IRSND_SUPPORT_MATSUSHITA_PROTOCOL == 1 || IRSND_SUPPORT_TECHNICS_PROTOCOL == 1 || \ IRSND_SUPPORT_KASEIKYO_PROTOCOL == 1 || IRSND_SUPPORT_RECS80_PROTOCOL == 1 || IRSND_SUPPORT_RECS80EXT_PROTOCOL == 1 || IRSND_SUPPORT_DENON_PROTOCOL == 1 || \ IRSND_SUPPORT_NUBERT_PROTOCOL == 1 || IRSND_SUPPORT_FAN_PROTOCOL == 1 || IRSND_SUPPORT_SPEAKER_PROTOCOL == 1 || IRSND_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1 || \ IRSND_SUPPORT_FDC_PROTOCOL == 1 || IRSND_SUPPORT_RCCAR_PROTOCOL == 1 || IRSND_SUPPORT_JVC_PROTOCOL == 1 || IRSND_SUPPORT_NIKON_PROTOCOL == 1 || \ diff --git a/irsndconfig.h b/irsndconfig.h index f3e90e4..a9b1cf0 100644 --- a/irsndconfig.h +++ b/irsndconfig.h @@ -5,7 +5,7 @@ * * Copyright (c) 2010-2015 Frank Meyer - frank(at)fli4l.de * - * $Id: irsndconfig.h,v 1.75 2015/06/15 11:40:55 fm Exp $ + * $Id: irsndconfig.h,v 1.77 2015/09/21 12:44:16 fm Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -84,6 +84,7 @@ #define IRSND_SUPPORT_PENTAX_PROTOCOL 0 // Pentax >= 10000 ~150 bytes #define IRSND_SUPPORT_S100_PROTOCOL 0 // S100 >= 10000 ~150 bytes #define IRSND_SUPPORT_ACP24_PROTOCOL 0 // ACP24 >= 10000 ~150 bytes +#define IRSND_SUPPORT_TECHNICS_PROTOCOL 0 // TECHNICS >= 10000 ~150 bytes /*--------------------------------------------------------------------------------------------------------------------------------------------------- -- 2.39.2