]> cloudbase.mooo.com Git - irmp.git/blobdiff - irsnd.c
Version 2.5.5: IRMP port to PIC XC8 compiler
[irmp.git] / irsnd.c
diff --git a/irsnd.c b/irsnd.c
index b3015000dd1357fcf65ea29bcc1a1c8f76d02729..554e264536a8b6405e0b9d9c86f7da2901726f06 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.75 2014/06/03 12:28:41 fm Exp $\r
+ * $Id: irsnd.c,v 1.76 2014/06/23 06:56:00 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
@@ -844,6 +844,23 @@ irsnd_send_data (IRMP_DATA * irmp_data_p, uint8_t do_wait)
             break;\r
         }\r
 #endif\r
+#if IRSND_SUPPORT_LGAIR_PROTOCOL == 1\r
+        case IRMP_LGAIR_PROTOCOL:\r
+        {\r
+            address = irmp_data_p->address;\r
+            command = irmp_data_p->command;\r
+\r
+            irsnd_buffer[0] = ( (address & 0x00FF));                                                            // AAAAAAAA\r
+            irsnd_buffer[1] = ( (command & 0xFF00) >> 8);                                                       // CCCCCCCC\r
+            irsnd_buffer[2] = ( (command & 0x00FF));                                                            // CCCCCCCC\r
+            irsnd_buffer[3] = (( ((command & 0xF000) >> 12) +                                                   // checksum\r
+                                 ((command & 0x0F00) >> 8) +\r
+                                 ((command & 0x00F0) >>4 ) +\r
+                                 ((command & 0x000F))) & 0x000F) << 4;\r
+            irsnd_busy      = TRUE;\r
+            break;\r
+        }\r
+#endif\r
 #if IRSND_SUPPORT_SAMSUNG_PROTOCOL == 1\r
         case IRMP_SAMSUNG_PROTOCOL:\r
         {\r
@@ -1426,6 +1443,24 @@ irsnd_ISR (void)
                         break;\r
                     }\r
 #endif\r
+#if IRSND_SUPPORT_LGAIR_PROTOCOL == 1\r
+                    case IRMP_LGAIR_PROTOCOL:\r
+                    {\r
+                        startbit_pulse_len          = NEC_START_BIT_PULSE_LEN;\r
+                        startbit_pause_len          = NEC_START_BIT_PAUSE_LEN - 1;\r
+                        pulse_1_len                 = NEC_PULSE_LEN;\r
+                        pause_1_len                 = NEC_1_PAUSE_LEN - 1;\r
+                        pulse_0_len                 = NEC_PULSE_LEN;\r
+                        pause_0_len                 = NEC_0_PAUSE_LEN - 1;\r
+                        has_stop_bit                = NEC_STOP_BIT;\r
+                        complete_data_len           = LGAIR_COMPLETE_DATA_LEN;\r
+                        n_auto_repetitions          = 1;                                            // 1 frame\r
+                        auto_repetition_pause_len   = 0;\r
+                        repeat_frame_pause_len      = NEC_FRAME_REPEAT_PAUSE_LEN;\r
+                        irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
+                        break;\r
+                    }\r
+#endif\r
 #if IRSND_SUPPORT_SAMSUNG_PROTOCOL == 1\r
                     case IRMP_SAMSUNG_PROTOCOL:\r
                     {\r
@@ -1926,6 +1961,9 @@ irsnd_ISR (void)
 #if IRSND_SUPPORT_NEC42_PROTOCOL == 1\r
                 case IRMP_NEC42_PROTOCOL:\r
 #endif\r
+#if IRSND_SUPPORT_LGAIR_PROTOCOL == 1\r
+                case IRMP_LGAIR_PROTOCOL:\r
+#endif\r
 #if IRSND_SUPPORT_SAMSUNG_PROTOCOL == 1\r
                 case IRMP_SAMSUNG_PROTOCOL:\r
                 case IRMP_SAMSUNG32_PROTOCOL:\r
@@ -1980,7 +2018,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_SAMSUNG_PROTOCOL == 1 || IRSND_SUPPORT_MATSUSHITA_PROTOCOL == 1 ||   \\r
+    IRSND_SUPPORT_LGAIR_PROTOCOL == 1 || IRSND_SUPPORT_SAMSUNG_PROTOCOL == 1 || IRSND_SUPPORT_MATSUSHITA_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_SPEAKER_PROTOCOL == 1 || IRSND_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1 || IRSND_SUPPORT_FDC_PROTOCOL == 1 || IRSND_SUPPORT_RCCAR_PROTOCOL == 1 ||   \\r
     IRSND_SUPPORT_JVC_PROTOCOL == 1 || IRSND_SUPPORT_NIKON_PROTOCOL == 1 || IRSND_SUPPORT_LEGO_PROTOCOL == 1 || IRSND_SUPPORT_THOMSON_PROTOCOL == 1 || \\r