]> cloudbase.mooo.com Git - irmp.git/commitdiff
Version 2.9.5: added TECHNICS protocol
authorukw <ukw@aeb2e35e-bfc4-4214-b83c-9e8de998ed28>
Mon, 21 Sep 2015 12:46:25 +0000 (12:46 +0000)
committerukw <ukw@aeb2e35e-bfc4-4214-b83c-9e8de998ed28>
Mon, 21 Sep 2015 12:46:25 +0000 (12:46 +0000)
git-svn-id: svn://mikrocontroller.net/irmp@164 aeb2e35e-bfc4-4214-b83c-9e8de998ed28

IR-Data/test-suite.sh
README.txt
irmp.c
irmp.h
irmpconfig.h
irmpprotocols.h
irsnd.c
irsndconfig.h

index 3ea37cafa6fadcc128e2a03f3e456b7cb8857c99..b0ffbb2be8f3006ca6eed214b9bb05eadacb9fe1 100644 (file)
@@ -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
 
index cd9262f93d78012b559eca5966a39e1a7d54c6e3..b834656d7780031a3b1be8fa2f88491d4485ec61 100644 (file)
@@ -1,8 +1,8 @@
 IRMP - Infrared Multi Protocol Decoder\r
 --------------------------------------\r
 \r
-Version IRMP:  2.9.4 15.06.2015\r
-Version IRSND: 2.9.4 15.06.2015\r
+Version IRMP:  2.9.5 20.06.2015\r
+Version IRSND: 2.9.5 20.06.2015\r
 \r
 Dokumentation:\r
  \r
diff --git a/irmp.c b/irmp.c
index 9c394365afd1b91991da391d213b17a8356f7117..8bf45dc90b1df4e334663a9ab0cb579f11356e62 100644 (file)
--- a/irmp.c
+++ b/irmp.c
@@ -3,7 +3,7 @@
  *\r
  * Copyright (c) 2009-2015 Frank Meyer - frank(at)fli4l.de\r
  *\r
- * $Id: irmp.c,v 1.176 2015/06/15 10:30:08 fm Exp $\r
+ * $Id: irmp.c,v 1.177 2015/09/19 15:28:31 fm Exp $\r
  *\r
  * Supported AVR mikrocontrollers:\r
  *\r
@@ -604,6 +604,7 @@ static const char proto_pentax[]        PROGMEM = "PENTAX";
 static const char proto_fan[]           PROGMEM = "FAN";\r
 static const char proto_s100[]          PROGMEM = "S100";\r
 static const char proto_acp24[]         PROGMEM = "ACP24";\r
+static const char proto_technics[]      PROGMEM = "TECHNICS";\r
 \r
 static const char proto_radio1[]        PROGMEM = "RADIO1";\r
 \r
@@ -657,6 +658,7 @@ irmp_protocol_names[IRMP_N_PROTOCOLS + 1] PROGMEM =
     proto_fan,\r
     proto_s100,\r
     proto_acp24,\r
+    proto_technics,\r
     proto_radio1\r
 };\r
 \r
@@ -3789,6 +3791,47 @@ irmp_ISR (void)
                                 irmp_param.complete_len = irmp_bit;                                 // patch length\r
                             }\r
 #endif // IRMP_SUPPORT_RCMM_PROTOCOL == 1\r
+\r
+#if IRMP_SUPPORT_TECHNICS_PROTOCOL == 1\r
+                            else if (irmp_param.protocol == IRMP_MATSUSHITA_PROTOCOL && irmp_bit == 22)  // it was a TECHNICS stop bit\r
+                            {\r
+#ifdef ANALYZE\r
+                                ANALYZE_PRINTF ("Switching to TECHNICS protocol, irmp_bit = %d\n", irmp_bit);\r
+#endif // ANALYZE\r
+                                // Situation:\r
+                                // The first 12 bits have been stored in irmp_tmp_command (LSB first)\r
+                                // The following 10 bits have been stored in irmp_tmp_address (LSB first)\r
+                                // The code of TECHNICS is:\r
+                                //   cccccccccccCCCCCCCCCCC (11 times c and 11 times C)\r
+                                //   ccccccccccccaaaaaaaaaa\r
+                                // where C is inverted value of c\r
+\r
+                                irmp_tmp_address <<= 1;\r
+                                if (irmp_tmp_command & (1<<11))\r
+                                {\r
+                                    irmp_tmp_address |= 1;\r
+                                    irmp_tmp_command &= ~(1<<11);\r
+                                }\r
+\r
+                                if (irmp_tmp_command == ((~irmp_tmp_address) & 0x07FF))\r
+                                {\r
+                                    irmp_tmp_address = 0;\r
+\r
+                                    irmp_param.protocol     = IRMP_TECHNICS_PROTOCOL;                   // switch protocol\r
+                                    irmp_param.complete_len = irmp_bit;                                 // patch length\r
+                                }\r
+                                else\r
+                                {\r
+#ifdef ANALYZE\r
+                                    ANALYZE_PRINTF ("error 8: TECHNICS frame error\n");\r
+                                    ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');\r
+#endif // ANALYZE\r
+                                    irmp_start_bit_detected = 0;                    // wait for another start bit...\r
+                                    irmp_pulse_time         = 0;\r
+                                    irmp_pause_time         = 0;\r
+                                }\r
+                            }\r
+#endif // IRMP_SUPPORT_TECHNICS_PROTOCOL == 1\r
                             else\r
                             {\r
 #ifdef ANALYZE\r
diff --git a/irmp.h b/irmp.h
index 232f53128af440f30318e37231a5919a9802862e..76346cefe6623e860388021fd087dd17e254e41e 100644 (file)
--- a/irmp.h
+++ b/irmp.h
@@ -3,7 +3,7 @@
  *\r
  * Copyright (c) 2009-2015 Frank Meyer - frank(at)fli4l.de\r
  *\r
- * $Id: irmp.h,v 1.96 2015/06/15 10:30:09 fm Exp $\r
+ * $Id: irmp.h,v 1.97 2015/09/19 15:28:31 fm Exp $\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
 #endif\r
 \r
+#if IRMP_SUPPORT_TECHNICS_PROTOCOL == 1\r
+#  undef IRMP_SUPPORT_MATSUSHITA_PROTOCOL\r
+#  define IRMP_SUPPORT_MATSUSHITA_PROTOCOL      1\r
+#endif\r
+\r
 #if IRMP_SUPPORT_DENON_PROTOCOL == 1 && IRMP_SUPPORT_RUWIDO_PROTOCOL == 1\r
 #  warning DENON protocol conflicts wih RUWIDO, please enable only one of both protocols\r
 #  warning RUWIDO protocol disabled\r
@@ -86,7 +91,7 @@
 #  warning DENON protocol conflicts wih ACP24, please enable only one of both protocols\r
 #  warning ACP24 protocol disabled\r
 #  undef IRMP_SUPPORT_ACP24_PROTOCOL\r
-#  define IRMP_SUPPORT_ACP24_PROTOCOL          0\r
+#  define IRMP_SUPPORT_ACP24_PROTOCOL           0\r
 #endif\r
 \r
 #if IRMP_SUPPORT_RC6_PROTOCOL == 1 && IRMP_SUPPORT_ROOMBA_PROTOCOL == 1\r
index 3bf9c60204372914443c297761e99b599b10e806..5c18ddd707ba53357a813b348a86c0a6cca423da 100644 (file)
@@ -6,7 +6,7 @@
  * Copyright (c) 2009-2015 Frank Meyer - frank(at)fli4l.de\r
  * Extensions for PIC 12F1820 W.Strobl 2014-07-20\r
  *\r
- * $Id: irmpconfig.h,v 1.134 2015/06/15 11:40:54 fm Exp $\r
+ * $Id: irmpconfig.h,v 1.136 2015/09/21 12:44:16 fm Exp $\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
@@ -95,6 +95,7 @@
 #define IRMP_SUPPORT_PENTAX_PROTOCOL            0       // Pentax               >= 10000                 ~150 bytes\r
 #define IRMP_SUPPORT_S100_PROTOCOL              0       // S100                 >= 10000                 ~250 bytes\r
 #define IRMP_SUPPORT_ACP24_PROTOCOL             0       // ACP24                >= 10000                 ~250 bytes\r
+#define IRMP_SUPPORT_TECHNICS_PROTOCOL          0       // TECHNICS             >= 10000                 ~250 bytes\r
 #define IRMP_SUPPORT_RADIO1_PROTOCOL            0       // RADIO, e.g. TEVION   >= 10000                 ~250 bytes (experimental)\r
 \r
 /*---------------------------------------------------------------------------------------------------------------------------------------------------\r
index d119d6cec21cb702ad50e0480f86fc6a730c104d..127268dde7bf9a4e361f7cd9d01205304fc2e69d 100644 (file)
@@ -5,7 +5,7 @@
  *\r
  * Copyright (c) 2013-2015 Frank Meyer - frank(at)fli4l.de\r
  *\r
- * $Id: irmpprotocols.h,v 1.36 2015/06/15 10:30:10 fm Exp $\r
+ * $Id: irmpprotocols.h,v 1.38 2015/09/20 10:51:37 fm Exp $\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
 #define IRMP_FAN_PROTOCOL                       44              // FAN (ventilator), very similar to NUBERT, but last bit is data bit instead of stop bit\r
 #define IRMP_S100_PROTOCOL                      45              // very similar to RC5, but 14 instead of 13 data bits\r
 #define IRMP_ACP24_PROTOCOL                     46              // Stiebel Eltron ACP24 air conditioner\r
-#define IRMP_RADIO1_PROTOCOL                    47              // Radio protocol (experimental status), do not use it yet!\r
+#define IRMP_TECHNICS_PROTOCOL                  47              // Technics, similar to Matsushita, but 22 instead of 24 bits\r
+#define IRMP_RADIO1_PROTOCOL                    48              // Radio protocol (experimental status), do not use it yet!\r
 \r
-#define IRMP_N_PROTOCOLS                        47              // number of supported protocols\r
+#define IRMP_N_PROTOCOLS                        48              // number of supported protocols\r
 \r
 /*---------------------------------------------------------------------------------------------------------------------------------------------------\r
  * timing constants:\r
@@ -221,6 +222,14 @@ typedef uint8_t     PAUSE_LEN;
 #define MATSUSHITA_LSB                          1                               // LSB...MSB?\r
 #define MATSUSHITA_FLAGS                        0                               // flags\r
 \r
+/*---------------------------------------------------------------------------------------------------------------------------------------------------\r
+ * TECHNICS: same timings as MATSUSHITA\r
+ *---------------------------------------------------------------------------------------------------------------------------------------------------\r
+ */\r
+#define TECHNICS_ADDRESS_LEN                    0                               // read 0 address bits\r
+#define TECHNICS_COMMAND_LEN                    11                              // read 11 bits\r
+#define TECHNICS_COMPLETE_DATA_LEN              22                              // complete length\r
+\r
 /*---------------------------------------------------------------------------------------------------------------------------------------------------\r
  * KASEIKYO:\r
  *---------------------------------------------------------------------------------------------------------------------------------------------------\r
diff --git a/irsnd.c b/irsnd.c
index 5ca85a1b19e3dafbb5ab13c7f788f9289447ddb3..8420675c2ae600beb3d92563bad22092c792f7e3 100644 (file)
--- a/irsnd.c
+++ b/irsnd.c
@@ -13,7 +13,7 @@
  * ATmega164, ATmega324, ATmega644,  ATmega644P, ATmega1284, ATmega1284P\r
  * ATmega88,  ATmega88P, ATmega168,  ATmega168P, ATmega328P\r
  *\r
- * $Id: irsnd.c,v 1.90 2015/06/15 10:30:11 fm Exp $\r
+ * $Id: irsnd.c,v 1.91 2015/09/20 10:51:37 fm Exp $\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
@@ -1054,6 +1054,18 @@ irsnd_send_data (IRMP_DATA * irmp_data_p, uint8_t do_wait)
             break;\r
         }\r
 #endif\r
+#if IRSND_SUPPORT_TECHNICS_PROTOCOL == 1\r
+        case IRMP_TECHNICS_PROTOCOL:\r
+        {\r
+            command = bitsrevervse (irmp_data_p->command, TECHNICS_COMMAND_LEN);\r
+\r
+            irsnd_buffer[0] = (command & 0x07FC) >> 3;                                                          // CCCCCCCC\r
+            irsnd_buffer[1] = ((command & 0x0007) << 5) | ((~command & 0x07C0) >> 6);                           // CCCccccc\r
+            irsnd_buffer[2] = (~command & 0x003F) << 2;                                                         // cccccc\r
+            irsnd_busy      = TRUE;\r
+            break;\r
+        }\r
+#endif\r
 #if IRSND_SUPPORT_KASEIKYO_PROTOCOL == 1\r
         case IRMP_KASEIKYO_PROTOCOL:\r
         {\r
@@ -1755,6 +1767,24 @@ irsnd_ISR (void)
                         break;\r
                     }\r
 #endif\r
+#if IRSND_SUPPORT_TECHNICS_PROTOCOL == 1\r
+                    case IRMP_TECHNICS_PROTOCOL:\r
+                    {\r
+                        startbit_pulse_len          = MATSUSHITA_START_BIT_PULSE_LEN;\r
+                        startbit_pause_len          = MATSUSHITA_START_BIT_PAUSE_LEN - 1;\r
+                        pulse_1_len                 = MATSUSHITA_PULSE_LEN;\r
+                        pause_1_len                 = MATSUSHITA_1_PAUSE_LEN - 1;\r
+                        pulse_0_len                 = MATSUSHITA_PULSE_LEN;\r
+                        pause_0_len                 = MATSUSHITA_0_PAUSE_LEN - 1;\r
+                        has_stop_bit                = MATSUSHITA_STOP_BIT;\r
+                        complete_data_len           = TECHNICS_COMPLETE_DATA_LEN;                   // here TECHNICS\r
+                        n_auto_repetitions          = 1;                                            // 1 frame\r
+                        auto_repetition_pause_len   = 0;\r
+                        repeat_frame_pause_len      = MATSUSHITA_FRAME_REPEAT_PAUSE_LEN;\r
+                        irsnd_set_freq (IRSND_FREQ_36_KHZ);\r
+                        break;\r
+                    }\r
+#endif\r
 #if IRSND_SUPPORT_KASEIKYO_PROTOCOL == 1\r
                     case IRMP_KASEIKYO_PROTOCOL:\r
                     {\r
@@ -2269,6 +2299,9 @@ irsnd_ISR (void)
 #if IRSND_SUPPORT_MATSUSHITA_PROTOCOL == 1\r
                 case IRMP_MATSUSHITA_PROTOCOL:\r
 #endif\r
+#if IRSND_SUPPORT_MATSUSHITA_PROTOCOL == 1\r
+                case IRMP_TECHNICS_PROTOCOL:\r
+#endif\r
 #if IRSND_SUPPORT_KASEIKYO_PROTOCOL == 1\r
                 case IRMP_KASEIKYO_PROTOCOL:\r
 #endif\r
@@ -2325,7 +2358,7 @@ irsnd_ISR (void)
 #endif\r
 \r
 #if IRSND_SUPPORT_SIRCS_PROTOCOL == 1  || IRSND_SUPPORT_NEC_PROTOCOL == 1 || IRSND_SUPPORT_NEC16_PROTOCOL == 1 || IRSND_SUPPORT_NEC42_PROTOCOL == 1 || \\r
-    IRSND_SUPPORT_LGAIR_PROTOCOL == 1 || IRSND_SUPPORT_SAMSUNG_PROTOCOL == 1 || IRSND_SUPPORT_MATSUSHITA_PROTOCOL == 1 ||   \\r
+    IRSND_SUPPORT_LGAIR_PROTOCOL == 1 || IRSND_SUPPORT_SAMSUNG_PROTOCOL == 1 || IRSND_SUPPORT_MATSUSHITA_PROTOCOL == 1 || IRSND_SUPPORT_TECHNICS_PROTOCOL == 1 || \\r
     IRSND_SUPPORT_KASEIKYO_PROTOCOL == 1 || IRSND_SUPPORT_RECS80_PROTOCOL == 1 || IRSND_SUPPORT_RECS80EXT_PROTOCOL == 1 || IRSND_SUPPORT_DENON_PROTOCOL == 1 || \\r
     IRSND_SUPPORT_NUBERT_PROTOCOL == 1 || IRSND_SUPPORT_FAN_PROTOCOL == 1 || IRSND_SUPPORT_SPEAKER_PROTOCOL == 1 || IRSND_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1 || \\r
     IRSND_SUPPORT_FDC_PROTOCOL == 1 || IRSND_SUPPORT_RCCAR_PROTOCOL == 1 || IRSND_SUPPORT_JVC_PROTOCOL == 1 || IRSND_SUPPORT_NIKON_PROTOCOL == 1 || \\r
index f3e90e478c8dda55e683afd3b8852131dd3c7cfc..a9b1cf0ded0ae85df26c4a929420569ba88df56e 100644 (file)
@@ -5,7 +5,7 @@
  *\r
  * Copyright (c) 2010-2015 Frank Meyer - frank(at)fli4l.de\r
  *\r
- * $Id: irsndconfig.h,v 1.75 2015/06/15 11:40:55 fm Exp $\r
+ * $Id: irsndconfig.h,v 1.77 2015/09/21 12:44:16 fm Exp $\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
@@ -84,6 +84,7 @@
 #define IRSND_SUPPORT_PENTAX_PROTOCOL           0       // Pentax               >= 10000                 ~150 bytes\r
 #define IRSND_SUPPORT_S100_PROTOCOL             0       // S100                 >= 10000                 ~150 bytes\r
 #define IRSND_SUPPORT_ACP24_PROTOCOL            0       // ACP24                >= 10000                 ~150 bytes\r
+#define IRSND_SUPPORT_TECHNICS_PROTOCOL         0       // TECHNICS             >= 10000                 ~150 bytes\r
 \r
 \r
 /*---------------------------------------------------------------------------------------------------------------------------------------------------\r