*\r
* Copyright (c) 2009-2015 Frank Meyer - frank(at)fli4l.de\r
*\r
- * $Id: irmp.c,v 1.181 2015/11/17 13:51:45 fm Exp $\r
+ * $Id: irmp.c,v 1.182 2015/11/18 08:27:50 fm Exp $\r
*\r
* Supported AVR mikrocontrollers:\r
*\r
# include "stm32f4xx_usart.h"\r
#elif defined(ARM_STM32F10X)\r
# define STM32_UART_COM USART3 // UART3 on PB10\r
-#elif defined(ARDUINO) // Arduino Serial implementation\r
+#elif defined(ARDUINO) // Arduino Serial implementation\r
# if defined(USB_SERIAL)\r
# include "usb_serial.h"\r
# else\r
\r
// UART enable\r
USART_Cmd(STM32_UART_COM, ENABLE);\r
- \r
+ \r
#elif defined(ARDUINO)\r
// we use the Arduino Serial Imlementation\r
// you have to call Serial.begin(SER_BAUD); in Arduino setup() function\r
// warten bis altes Byte gesendet wurde\r
while (USART_GetFlagStatus(STM32_UART_COM, USART_FLAG_TXE) == RESET)\r
{\r
- ;\r
+ ;\r
}\r
\r
USART_SendData(STM32_UART_COM, ch);\r
\r
if (ch == '\n')\r
{\r
- while (USART_GetFlagStatus(STM32_UART_COM, USART_FLAG_TXE) == RESET);\r
- USART_SendData(STM32_UART_COM, '\r');\r
+ while (USART_GetFlagStatus(STM32_UART_COM, USART_FLAG_TXE) == RESET);\r
+ USART_SendData(STM32_UART_COM, '\r');\r
}\r
\r
#elif defined(ARDUINO)\r
\r
#else\r
#if (IRMP_EXT_LOGGING == 0)\r
- \r
- # if defined (__AVR_XMEGA__)\r
- while (!(USARTC1.STATUS & USART_DREIF_bm));\r
- USARTC1.DATA = ch;\r
- \r
- # else //AVR_MEGA\r
+ \r
+ # if defined (__AVR_XMEGA__)\r
+ while (!(USARTC1.STATUS & USART_DREIF_bm));\r
+ USARTC1.DATA = ch;\r
+ \r
+ # else //AVR_MEGA\r
while (!(UART0_UCSRA & UART0_UDRE_BIT_VALUE))\r
{\r
- ;\r
+ ;\r
}\r
\r
UART0_UDR = ch;\r
- #endif //__AVR_XMEGA__\r
+ #endif //__AVR_XMEGA__\r
#else\r
\r
sendextlog(ch); // use external log\r
\r
if (! val && (startcycles < STARTCYCLES) && !buf_idx) // prevent that single random zeros init logging\r
{\r
- startcycles++;\r
+ startcycles++;\r
}\r
else\r
{\r
- startcycles = 0;\r
-\r
- if (! val || buf_idx != 0) // start or continue logging on "0", "1" cannot init logging\r
- {\r
- if (last_val == val)\r
- {\r
- cnt++;\r
-\r
- if (val && cnt > ENDBITS) // if high received then look at log-stop condition\r
- { // if stop condition is true, output on uart\r
- uint_fast8_t i8;\r
- uint_fast16_t i;\r
- uint_fast16_t j;\r
- uint_fast8_t v = '1';\r
- uint_fast16_t d;\r
-\r
- for (i8 = 0; i8 < STARTCYCLES; i8++)\r
- {\r
- irmp_uart_putc ('0'); // the ignored starting zeros\r
- }\r
-\r
- for (i = 0; i < buf_idx; i++)\r
- {\r
- d = buf[i];\r
-\r
- if (d == 0xff)\r
- {\r
- i++;\r
- d = buf[i];\r
- i++;\r
- d |= ((uint_fast16_t) buf[i] << 8);\r
- }\r
-\r
- for (j = 0; j < d; j++)\r
- {\r
- irmp_uart_putc (v);\r
- }\r
-\r
- v = (v == '1') ? '0' : '1';\r
- }\r
-\r
- for (i8 = 0; i8 < 20; i8++)\r
- {\r
- irmp_uart_putc ('1');\r
- }\r
-\r
- irmp_uart_putc ('\n');\r
- buf_idx = 0;\r
- last_val = 1;\r
- cnt = 0;\r
- }\r
- }\r
- else if (buf_idx < DATALEN - 3)\r
- {\r
- if (cnt >= 0xff)\r
- {\r
- buf[buf_idx++] = 0xff;\r
- buf[buf_idx++] = (cnt & 0xff);\r
- buf[buf_idx] = (cnt >> 8);\r
- }\r
- else\r
- {\r
- buf[buf_idx] = cnt;\r
- }\r
-\r
- buf_idx++;\r
- cnt = 1;\r
- last_val = val;\r
- }\r
- }\r
+ startcycles = 0;\r
+\r
+ if (! val || buf_idx != 0) // start or continue logging on "0", "1" cannot init logging\r
+ {\r
+ if (last_val == val)\r
+ {\r
+ cnt++;\r
+\r
+ if (val && cnt > ENDBITS) // if high received then look at log-stop condition\r
+ { // if stop condition is true, output on uart\r
+ uint_fast8_t i8;\r
+ uint_fast16_t i;\r
+ uint_fast16_t j;\r
+ uint_fast8_t v = '1';\r
+ uint_fast16_t d;\r
+\r
+ for (i8 = 0; i8 < STARTCYCLES; i8++)\r
+ {\r
+ irmp_uart_putc ('0'); // the ignored starting zeros\r
+ }\r
+\r
+ for (i = 0; i < buf_idx; i++)\r
+ {\r
+ d = buf[i];\r
+\r
+ if (d == 0xff)\r
+ {\r
+ i++;\r
+ d = buf[i];\r
+ i++;\r
+ d |= ((uint_fast16_t) buf[i] << 8);\r
+ }\r
+\r
+ for (j = 0; j < d; j++)\r
+ {\r
+ irmp_uart_putc (v);\r
+ }\r
+\r
+ v = (v == '1') ? '0' : '1';\r
+ }\r
+\r
+ for (i8 = 0; i8 < 20; i8++)\r
+ {\r
+ irmp_uart_putc ('1');\r
+ }\r
+\r
+ irmp_uart_putc ('\n');\r
+ buf_idx = 0;\r
+ last_val = 1;\r
+ cnt = 0;\r
+ }\r
+ }\r
+ else if (buf_idx < DATALEN - 3)\r
+ {\r
+ if (cnt >= 0xff)\r
+ {\r
+ buf[buf_idx++] = 0xff;\r
+ buf[buf_idx++] = (cnt & 0xff);\r
+ buf[buf_idx] = (cnt >> 8);\r
+ }\r
+ else\r
+ {\r
+ buf[buf_idx] = cnt;\r
+ }\r
+\r
+ buf_idx++;\r
+ cnt = 1;\r
+ last_val = val;\r
+ }\r
+ }\r
}\r
}\r
\r
IRMP_GPIO_STRUCT->DDR &= ~(1<<IRMP_BIT); // pin is input\r
IRMP_GPIO_STRUCT->CR1 |= (1<<IRMP_BIT); // activate pullup\r
\r
-#elif defined (TEENSY_ARM_CORTEX_M4) // TEENSY\r
+#elif defined (TEENSY_ARM_CORTEX_M4) // TEENSY\r
pinMode(IRMP_PIN, INPUT);\r
\r
#else // AVR\r
\r
if (irmp_ir_detected)\r
{\r
- switch (irmp_protocol)\r
- {\r
+ switch (irmp_protocol)\r
+ {\r
#if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1\r
- case IRMP_SAMSUNG_PROTOCOL:\r
- if ((irmp_command >> 8) == (~irmp_command & 0x00FF))\r
- {\r
- irmp_command &= 0xff;\r
- irmp_command |= irmp_id << 8;\r
- rtc = TRUE;\r
- }\r
- break;\r
+ case IRMP_SAMSUNG_PROTOCOL:\r
+ if ((irmp_command >> 8) == (~irmp_command & 0x00FF))\r
+ {\r
+ irmp_command &= 0xff;\r
+ irmp_command |= irmp_id << 8;\r
+ rtc = TRUE;\r
+ }\r
+ break;\r
\r
#if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1\r
- case IRMP_SAMSUNG48_PROTOCOL:\r
- irmp_command = (irmp_command & 0x00FF) | ((irmp_id & 0x00FF) << 8);\r
- rtc = TRUE;\r
- break;\r
+ case IRMP_SAMSUNG48_PROTOCOL:\r
+ irmp_command = (irmp_command & 0x00FF) | ((irmp_id & 0x00FF) << 8);\r
+ rtc = TRUE;\r
+ break;\r
#endif\r
#endif\r
\r
#if IRMP_SUPPORT_NEC_PROTOCOL == 1\r
- case IRMP_NEC_PROTOCOL:\r
- if ((irmp_command >> 8) == (~irmp_command & 0x00FF))\r
- {\r
- irmp_command &= 0xff;\r
- rtc = TRUE;\r
- }\r
- else if (irmp_address == 0x87EE)\r
- {\r
-#ifdef ANALYZE\r
- ANALYZE_PRINTF ("Switching to APPLE protocol\n");\r
-#endif // ANALYZE\r
- irmp_protocol = IRMP_APPLE_PROTOCOL;\r
- irmp_address = (irmp_command & 0xFF00) >> 8;\r
- irmp_command &= 0x00FF;\r
- rtc = TRUE;\r
- }\r
- break;\r
+ case IRMP_NEC_PROTOCOL:\r
+ if ((irmp_command >> 8) == (~irmp_command & 0x00FF))\r
+ {\r
+ irmp_command &= 0xff;\r
+ rtc = TRUE;\r
+ }\r
+ else if (irmp_address == 0x87EE)\r
+ {\r
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("Switching to APPLE protocol\n");\r
+#endif // ANALYZE\r
+ irmp_protocol = IRMP_APPLE_PROTOCOL;\r
+ irmp_address = (irmp_command & 0xFF00) >> 8;\r
+ irmp_command &= 0x00FF;\r
+ rtc = TRUE;\r
+ }\r
+ break;\r
#endif\r
#if IRMP_SUPPORT_BOSE_PROTOCOL == 1\r
- case IRMP_BOSE_PROTOCOL:\r
- if ((irmp_command >> 8) == (~irmp_command & 0x00FF))\r
- {\r
- irmp_command &= 0xff;\r
- rtc = TRUE;\r
- }\r
- break;\r
+ case IRMP_BOSE_PROTOCOL:\r
+ if ((irmp_command >> 8) == (~irmp_command & 0x00FF))\r
+ {\r
+ irmp_command &= 0xff;\r
+ rtc = TRUE;\r
+ }\r
+ break;\r
#endif\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
- rtc = TRUE;\r
- }\r
- break;\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
+ rtc = TRUE;\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
+ 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
+ case IRMP_RC5_PROTOCOL:\r
+ irmp_address &= ~0x20; // clear toggle bit\r
+ rtc = TRUE;\r
+ break;\r
#endif\r
#if IRMP_SUPPORT_S100_PROTOCOL == 1\r
- case IRMP_S100_PROTOCOL:\r
- irmp_address &= ~0x20; // clear toggle bit\r
- rtc = TRUE;\r
- break;\r
+ case IRMP_S100_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
-#ifdef ANALYZE\r
- ANALYZE_PRINTF("Info IR60: got start instruction frame\n");\r
-#endif // ANALYZE\r
- }\r
- break;\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
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF("Info IR60: got start instruction frame\n");\r
+#endif // ANALYZE\r
+ }\r
+ break;\r
#endif\r
#if IRMP_SUPPORT_RCCAR_PROTOCOL == 1\r
- case IRMP_RCCAR_PROTOCOL:\r
- // frame in irmp_data:\r
- // Bit 12 11 10 9 8 7 6 5 4 3 2 1 0\r
- // V D7 D6 D5 D4 D3 D2 D1 D0 A1 A0 C1 C0 // 10 9 8 7 6 5 4 3 2 1 0\r
- irmp_address = (irmp_command & 0x000C) >> 2; // addr: 0 0 0 0 0 0 0 0 0 A1 A0\r
- irmp_command = ((irmp_command & 0x1000) >> 2) | // V-Bit: V 0 0 0 0 0 0 0 0 0 0\r
- ((irmp_command & 0x0003) << 8) | // C-Bits: 0 C1 C0 0 0 0 0 0 0 0 0\r
- ((irmp_command & 0x0FF0) >> 4); // D-Bits: D7 D6 D5 D4 D3 D2 D1 D0\r
- rtc = TRUE; // Summe: V C1 C0 D7 D6 D5 D4 D3 D2 D1 D0\r
- break;\r
+ case IRMP_RCCAR_PROTOCOL:\r
+ // frame in irmp_data:\r
+ // Bit 12 11 10 9 8 7 6 5 4 3 2 1 0\r
+ // V D7 D6 D5 D4 D3 D2 D1 D0 A1 A0 C1 C0 // 10 9 8 7 6 5 4 3 2 1 0\r
+ irmp_address = (irmp_command & 0x000C) >> 2; // addr: 0 0 0 0 0 0 0 0 0 A1 A0\r
+ irmp_command = ((irmp_command & 0x1000) >> 2) | // V-Bit: V 0 0 0 0 0 0 0 0 0 0\r
+ ((irmp_command & 0x0003) << 8) | // C-Bits: 0 C1 C0 0 0 0 0 0 0 0 0\r
+ ((irmp_command & 0x0FF0) >> 4); // D-Bits: D7 D6 D5 D4 D3 D2 D1 D0\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
-#ifdef ANALYZE\r
- ANALYZE_PRINTF("error NETBOX: bit6/7 must be 0/1\n");\r
-#endif // ANALYZE\r
- }\r
- }\r
- else\r
- {\r
-#ifdef ANALYZE\r
- ANALYZE_PRINTF("error NETBOX: last bit not set\n");\r
-#endif // ANALYZE\r
- }\r
- break;\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
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF("error NETBOX: bit6/7 must be 0/1\n");\r
+#endif // ANALYZE\r
+ }\r
+ }\r
+ else\r
+ {\r
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF("error NETBOX: last bit not set\n");\r
+#endif // ANALYZE\r
+ }\r
+ break;\r
#endif\r
#if IRMP_SUPPORT_LEGO_PROTOCOL == 1\r
- case IRMP_LEGO_PROTOCOL:\r
- {\r
- uint_fast8_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
-#ifdef ANALYZE\r
- ANALYZE_PRINTF ("CRC error in LEGO protocol\n");\r
-#endif // ANALYZE\r
- // rtc = TRUE; // don't accept codes with CRC errors\r
- }\r
- break;\r
- }\r
+ case IRMP_LEGO_PROTOCOL:\r
+ {\r
+ uint_fast8_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
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("CRC error in LEGO protocol\n");\r
+#endif // ANALYZE\r
+ // rtc = TRUE; // don't accept codes with CRC errors\r
+ }\r
+ break;\r
+ }\r
#endif\r
\r
- default:\r
- {\r
- rtc = TRUE;\r
- break;\r
- }\r
- }\r
-\r
- if (rtc)\r
- {\r
- irmp_data_p->protocol = irmp_protocol;\r
- irmp_data_p->address = irmp_address;\r
- irmp_data_p->command = irmp_command;\r
- irmp_data_p->flags = irmp_flags;\r
- irmp_command = 0;\r
- irmp_address = 0;\r
- irmp_flags = 0;\r
- }\r
-\r
- irmp_ir_detected = FALSE;\r
+ default:\r
+ {\r
+ rtc = TRUE;\r
+ break;\r
+ }\r
+ }\r
+\r
+ if (rtc)\r
+ {\r
+ irmp_data_p->protocol = irmp_protocol;\r
+ irmp_data_p->address = irmp_address;\r
+ irmp_data_p->command = irmp_command;\r
+ irmp_data_p->flags = irmp_flags;\r
+ irmp_command = 0;\r
+ irmp_address = 0;\r
+ irmp_flags = 0;\r
+ }\r
+\r
+ irmp_ir_detected = FALSE;\r
}\r
\r
return rtc;\r
#if IRMP_SUPPORT_ACP24_PROTOCOL == 1\r
if (irmp_param.protocol == IRMP_ACP24_PROTOCOL) // squeeze 64 bits into 16 bits:\r
{\r
- if (value)\r
- {\r
- // ACP24-Frame:\r
- // 1 2 3 4 5 6\r
- // 0123456789012345678901234567890123456789012345678901234567890123456789\r
- // N VVMMM ? ??? t vmA x y TTTT\r
- //\r
- // irmp_data_p->command:\r
- //\r
- // 5432109876543210\r
- // NAVVvMMMmtxyTTTT\r
-\r
- switch (irmp_bit)\r
- {\r
- case 0: irmp_tmp_command |= (1<<15); break; // N\r
- case 2: irmp_tmp_command |= (1<<13); break; // V\r
- case 3: irmp_tmp_command |= (1<<12); break; // V\r
- case 4: irmp_tmp_command |= (1<<10); break; // M\r
- case 5: irmp_tmp_command |= (1<< 9); break; // M\r
- case 6: irmp_tmp_command |= (1<< 8); break; // M\r
- case 20: irmp_tmp_command |= (1<< 6); break; // t\r
- case 22: irmp_tmp_command |= (1<<11); break; // v\r
- case 23: irmp_tmp_command |= (1<< 7); break; // m\r
- case 24: irmp_tmp_command |= (1<<14); break; // A\r
- case 26: irmp_tmp_command |= (1<< 5); break; // x\r
- case 44: irmp_tmp_command |= (1<< 4); break; // y\r
- case 66: irmp_tmp_command |= (1<< 3); break; // T\r
- case 67: irmp_tmp_command |= (1<< 2); break; // T\r
- case 68: irmp_tmp_command |= (1<< 1); break; // T\r
- case 69: irmp_tmp_command |= (1<< 0); break; // T\r
- }\r
- }\r
+ if (value)\r
+ {\r
+ // ACP24-Frame:\r
+ // 1 2 3 4 5 6\r
+ // 0123456789012345678901234567890123456789012345678901234567890123456789\r
+ // N VVMMM ? ??? t vmA x y TTTT\r
+ //\r
+ // irmp_data_p->command:\r
+ //\r
+ // 5432109876543210\r
+ // NAVVvMMMmtxyTTTT\r
+\r
+ switch (irmp_bit)\r
+ {\r
+ case 0: irmp_tmp_command |= (1<<15); break; // N\r
+ case 2: irmp_tmp_command |= (1<<13); break; // V\r
+ case 3: irmp_tmp_command |= (1<<12); break; // V\r
+ case 4: irmp_tmp_command |= (1<<10); break; // M\r
+ case 5: irmp_tmp_command |= (1<< 9); break; // M\r
+ case 6: irmp_tmp_command |= (1<< 8); break; // M\r
+ case 20: irmp_tmp_command |= (1<< 6); break; // t\r
+ case 22: irmp_tmp_command |= (1<<11); break; // v\r
+ case 23: irmp_tmp_command |= (1<< 7); break; // m\r
+ case 24: irmp_tmp_command |= (1<<14); break; // A\r
+ case 26: irmp_tmp_command |= (1<< 5); break; // x\r
+ case 44: irmp_tmp_command |= (1<< 4); break; // y\r
+ case 66: irmp_tmp_command |= (1<< 3); break; // T\r
+ case 67: irmp_tmp_command |= (1<< 2); break; // T\r
+ case 68: irmp_tmp_command |= (1<< 1); break; // T\r
+ case 69: irmp_tmp_command |= (1<< 0); break; // T\r
+ }\r
+ }\r
}\r
else\r
#endif // IRMP_SUPPORT_ACP24_PROTOCOL\r
#if IRMP_SUPPORT_ORTEK_PROTOCOL == 1\r
if (irmp_param.protocol == IRMP_ORTEK_PROTOCOL)\r
{\r
- if (irmp_bit < 14)\r
- {\r
- if (value)\r
- {\r
- parity++;\r
- }\r
- }\r
- else if (irmp_bit == 14)\r
- {\r
- if (value) // value == 1: even parity\r
- {\r
- if (parity & 0x01)\r
- {\r
- parity = PARITY_CHECK_FAILED;\r
- }\r
- else\r
- {\r
- parity = PARITY_CHECK_OK;\r
- }\r
- }\r
- else\r
- {\r
- if (parity & 0x01) // value == 0: odd parity\r
- {\r
- parity = PARITY_CHECK_OK;\r
- }\r
- else\r
- {\r
- parity = PARITY_CHECK_FAILED;\r
- }\r
- }\r
- }\r
+ if (irmp_bit < 14)\r
+ {\r
+ if (value)\r
+ {\r
+ parity++;\r
+ }\r
+ }\r
+ else if (irmp_bit == 14)\r
+ {\r
+ if (value) // value == 1: even parity\r
+ {\r
+ if (parity & 0x01)\r
+ {\r
+ parity = PARITY_CHECK_FAILED;\r
+ }\r
+ else\r
+ {\r
+ parity = PARITY_CHECK_OK;\r
+ }\r
+ }\r
+ else\r
+ {\r
+ if (parity & 0x01) // value == 0: odd parity\r
+ {\r
+ parity = PARITY_CHECK_OK;\r
+ }\r
+ else\r
+ {\r
+ parity = PARITY_CHECK_FAILED;\r
+ }\r
+ }\r
+ }\r
}\r
else\r
#endif\r
{\r
- ;\r
+ ;\r
}\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
+ 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
- if (irmp_param.lsb_first)\r
- {\r
- irmp_tmp_address |= (((uint_fast16_t) (value)) << (irmp_bit - irmp_param.address_offset)); // CV wants cast\r
- }\r
- else\r
- {\r
- irmp_tmp_address <<= 1;\r
- irmp_tmp_address |= value;\r
- }\r
+ if (irmp_param.lsb_first)\r
+ {\r
+ irmp_tmp_address |= (((uint_fast16_t) (value)) << (irmp_bit - irmp_param.address_offset)); // CV wants cast\r
+ }\r
+ else\r
+ {\r
+ irmp_tmp_address <<= 1;\r
+ irmp_tmp_address |= value;\r
+ }\r
}\r
else if (irmp_bit >= irmp_param.command_offset && irmp_bit < irmp_param.command_end)\r
{\r
- if (irmp_param.lsb_first)\r
- {\r
+ if (irmp_param.lsb_first)\r
+ {\r
#if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1\r
- if (irmp_param.protocol == IRMP_SAMSUNG48_PROTOCOL && irmp_bit >= 32)\r
- {\r
- irmp_tmp_id |= (((uint_fast16_t) (value)) << (irmp_bit - 32)); // CV wants cast\r
- }\r
- else\r
+ if (irmp_param.protocol == IRMP_SAMSUNG48_PROTOCOL && irmp_bit >= 32)\r
+ {\r
+ irmp_tmp_id |= (((uint_fast16_t) (value)) << (irmp_bit - 32)); // CV wants cast\r
+ }\r
+ else\r
#endif\r
- {\r
- irmp_tmp_command |= (((uint_fast16_t) (value)) << (irmp_bit - irmp_param.command_offset)); // CV wants cast\r
- }\r
- }\r
- else\r
- {\r
- irmp_tmp_command <<= 1;\r
- irmp_tmp_command |= value;\r
- }\r
+ {\r
+ irmp_tmp_command |= (((uint_fast16_t) (value)) << (irmp_bit - irmp_param.command_offset)); // CV wants cast\r
+ }\r
+ }\r
+ else\r
+ {\r
+ irmp_tmp_command <<= 1;\r
+ irmp_tmp_command |= value;\r
+ }\r
}\r
\r
#if IRMP_SUPPORT_LGAIR_PROTOCOL == 1\r
if (irmp_param.protocol == IRMP_NEC_PROTOCOL || irmp_param.protocol == IRMP_NEC42_PROTOCOL)\r
{\r
- if (irmp_bit < 8)\r
- {\r
- irmp_lgair_address <<= 1; // LGAIR uses MSB\r
- irmp_lgair_address |= value;\r
- }\r
- else if (irmp_bit < 24)\r
- {\r
- irmp_lgair_command <<= 1; // LGAIR uses MSB\r
- irmp_lgair_command |= value;\r
- }\r
+ if (irmp_bit < 8)\r
+ {\r
+ irmp_lgair_address <<= 1; // LGAIR uses MSB\r
+ irmp_lgair_address |= value;\r
+ }\r
+ else if (irmp_bit < 24)\r
+ {\r
+ irmp_lgair_command <<= 1; // LGAIR uses MSB\r
+ irmp_lgair_command |= value;\r
+ }\r
}\r
// NO else!\r
#endif\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_address2 |= (((uint_fast16_t) (value)) << (irmp_bit - 13)); // CV wants cast\r
+ irmp_tmp_address2 |= (((uint_fast16_t) (value)) << (irmp_bit - 13)); // CV wants cast\r
}\r
else\r
#endif\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_id |= (((uint_fast16_t) (value)) << (irmp_bit - SAMSUNG_ID_OFFSET)); // store with LSB first\r
+ irmp_tmp_id |= (((uint_fast16_t) (value)) << (irmp_bit - SAMSUNG_ID_OFFSET)); // store with LSB first\r
}\r
else\r
#endif\r
#if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1\r
if (irmp_param.protocol == IRMP_KASEIKYO_PROTOCOL)\r
{\r
- if (irmp_bit >= 20 && irmp_bit < 24)\r
- {\r
- irmp_tmp_command |= (((uint_fast16_t) (value)) << (irmp_bit - 8)); // store 4 system bits (genre 1) in upper nibble with LSB first\r
- }\r
- else if (irmp_bit >= 24 && irmp_bit < 28)\r
- {\r
- genre2 |= (((uint_fast8_t) (value)) << (irmp_bit - 20)); // store 4 system bits (genre 2) in upper nibble with LSB first\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
+ if (irmp_bit >= 20 && irmp_bit < 24)\r
+ {\r
+ irmp_tmp_command |= (((uint_fast16_t) (value)) << (irmp_bit - 8)); // store 4 system bits (genre 1) in upper nibble with LSB first\r
+ }\r
+ else if (irmp_bit >= 24 && irmp_bit < 28)\r
+ {\r
+ genre2 |= (((uint_fast8_t) (value)) << (irmp_bit - 20)); // store 4 system bits (genre 2) in upper nibble with LSB first\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
else\r
#endif\r
{\r
- ;\r
+ ;\r
}\r
\r
irmp_bit++;\r
\r
if (irmp_param.protocol)\r
{\r
- irmp_bit2 = irmp_bit - 2;\r
+ irmp_bit2 = irmp_bit - 2;\r
}\r
else\r
{\r
- irmp_bit2 = irmp_bit - 1;\r
+ irmp_bit2 = irmp_bit - 1;\r
}\r
\r
if (irmp_bit2 >= irmp_param2.address_offset && irmp_bit2 < irmp_param2.address_end)\r
{\r
- irmp_tmp_address2 |= (((uint_fast16_t) (value)) << (irmp_bit2 - irmp_param2.address_offset)); // CV wants cast\r
+ irmp_tmp_address2 |= (((uint_fast16_t) (value)) << (irmp_bit2 - irmp_param2.address_offset)); // CV wants cast\r
}\r
else if (irmp_bit2 >= irmp_param2.command_offset && irmp_bit2 < irmp_param2.command_end)\r
{\r
- irmp_tmp_command2 |= (((uint_fast16_t) (value)) << (irmp_bit2 - irmp_param2.command_offset)); // CV wants cast\r
+ irmp_tmp_command2 |= (((uint_fast16_t) (value)) << (irmp_bit2 - irmp_param2.command_offset)); // CV wants cast\r
}\r
}\r
#endif // IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)\r
#if IRMP_USE_CALLBACK == 1\r
if (irmp_callback_ptr)\r
{\r
- static uint_fast8_t last_inverted_input;\r
+ static uint_fast8_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
+ 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
\r
if (! irmp_ir_detected) // ir code already detected?\r
{ // no...\r
- if (! irmp_start_bit_detected) // start bit detected?\r
- { // no...\r
- if (! irmp_input) // receiving burst?\r
- { // yes...\r
+ if (! irmp_start_bit_detected) // start bit 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("%8.3fms [starting pulse]\n", (double) (time_counter * 1000) / F_INTERRUPTS);\r
- }\r
-#endif // ANALYZE\r
- irmp_pulse_time++; // increment counter\r
- }\r
- else\r
- { // no...\r
- if (irmp_pulse_time) // it's dark....\r
- { // set flags for counting the time of darkness...\r
- irmp_start_bit_detected = 1;\r
- wait_for_start_space = 1;\r
- wait_for_space = 0;\r
- irmp_tmp_command = 0;\r
- irmp_tmp_address = 0;\r
+ if (! irmp_pulse_time)\r
+ {\r
+ ANALYZE_PRINTF("%8.3fms [starting pulse]\n", (double) (time_counter * 1000) / F_INTERRUPTS);\r
+ }\r
+#endif // ANALYZE\r
+ irmp_pulse_time++; // increment counter\r
+ }\r
+ else\r
+ { // no...\r
+ if (irmp_pulse_time) // it's dark....\r
+ { // set flags for counting the time of darkness...\r
+ irmp_start_bit_detected = 1;\r
+ wait_for_start_space = 1;\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
+ genre2 = 0;\r
#endif\r
#if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1\r
- irmp_tmp_id = 0;\r
+ irmp_tmp_id = 0;\r
#endif\r
\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
+ irmp_tmp_command2 = 0;\r
+ irmp_tmp_address2 = 0;\r
#endif\r
#if IRMP_SUPPORT_LGAIR_PROTOCOL == 1\r
- irmp_lgair_command = 0;\r
- irmp_lgair_address = 0;\r
+ irmp_lgair_command = 0;\r
+ irmp_lgair_address = 0;\r
#endif\r
- irmp_bit = 0xff;\r
- irmp_pause_time = 1; // 1st pause: set to 1, not to 0!\r
+ irmp_bit = 0xff;\r
+ irmp_pause_time = 1; // 1st pause: set to 1, not to 0!\r
#if IRMP_SUPPORT_RC5_PROTOCOL == 1 || IRMP_SUPPORT_S100_PROTOCOL == 1\r
- rc5_cmd_bit6 = 0; // fm 2010-03-07: bugfix: reset it after incomplete RC5 frame!\r
+ rc5_cmd_bit6 = 0; // fm 2010-03-07: bugfix: reset it after incomplete RC5 frame!\r
#endif\r
- }\r
- else\r
- {\r
- if (key_repetition_len < 0xFFFF) // avoid overflow of counter\r
- {\r
- key_repetition_len++;\r
+ }\r
+ else\r
+ {\r
+ if (key_repetition_len < 0xFFFF) // avoid overflow of counter\r
+ {\r
+ key_repetition_len++;\r
\r
#if IRMP_SUPPORT_DENON_PROTOCOL == 1\r
- if (denon_repetition_len < 0xFFFF) // avoid overflow of counter\r
- {\r
- denon_repetition_len++;\r
+ if (denon_repetition_len < 0xFFFF) // avoid overflow of counter\r
+ {\r
+ denon_repetition_len++;\r
\r
- if (denon_repetition_len >= DENON_AUTO_REPETITION_PAUSE_LEN && last_irmp_denon_command != 0)\r
- {\r
+ if (denon_repetition_len >= DENON_AUTO_REPETITION_PAUSE_LEN && last_irmp_denon_command != 0)\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("%8.3fms warning: did not receive inverted command repetition\n",\r
- (double) (time_counter * 1000) / F_INTERRUPTS);\r
+ ANALYZE_PRINTF ("%8.3fms warning: did not receive inverted command repetition\n",\r
+ (double) (time_counter * 1000) / F_INTERRUPTS);\r
#endif // ANALYZE\r
- last_irmp_denon_command = 0;\r
- denon_repetition_len = 0xFFFF;\r
- }\r
- }\r
+ last_irmp_denon_command = 0;\r
+ denon_repetition_len = 0xFFFF;\r
+ }\r
+ }\r
#endif // IRMP_SUPPORT_DENON_PROTOCOL == 1\r
- }\r
- }\r
- }\r
- }\r
- else\r
- {\r
- if (wait_for_start_space) // we have received start bit...\r
- { // ...and are counting the time of darkness\r
- if (irmp_input) // still dark?\r
- { // yes\r
- irmp_pause_time++; // increment counter\r
+ }\r
+ }\r
+ }\r
+ }\r
+ else\r
+ {\r
+ if (wait_for_start_space) // we have received start bit...\r
+ { // ...and are counting the time of darkness\r
+ if (irmp_input) // still dark?\r
+ { // yes\r
+ irmp_pause_time++; // increment counter\r
\r
#if IRMP_SUPPORT_NIKON_PROTOCOL == 1\r
- if (((irmp_pulse_time < NIKON_START_BIT_PULSE_LEN_MIN || irmp_pulse_time > NIKON_START_BIT_PULSE_LEN_MAX) && irmp_pause_time > IRMP_TIMEOUT_LEN) ||\r
- irmp_pause_time > IRMP_TIMEOUT_NIKON_LEN)\r
+ if (((irmp_pulse_time < NIKON_START_BIT_PULSE_LEN_MIN || irmp_pulse_time > NIKON_START_BIT_PULSE_LEN_MAX) && irmp_pause_time > IRMP_TIMEOUT_LEN) ||\r
+ irmp_pause_time > IRMP_TIMEOUT_NIKON_LEN)\r
#else\r
- if (irmp_pause_time > IRMP_TIMEOUT_LEN) // timeout?\r
+ if (irmp_pause_time > IRMP_TIMEOUT_LEN) // timeout?\r
#endif\r
- { // yes...\r
+ { // yes...\r
#if IRMP_SUPPORT_JVC_PROTOCOL == 1\r
- if (irmp_protocol == IRMP_JVC_PROTOCOL) // don't show eror if JVC protocol, irmp_pulse_time has been set below!\r
- {\r
- ;\r
- }\r
- else\r
+ if (irmp_protocol == IRMP_JVC_PROTOCOL) // don't show eror if JVC protocol, irmp_pulse_time has been set below!\r
+ {\r
+ ;\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_JVC_PROTOCOL == 1\r
- {\r
+ {\r
#ifdef ANALYZE\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
+ 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
#endif // ANALYZE\r
- }\r
+ }\r
\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
- }\r
- }\r
- else\r
- { // receiving first data pulse!\r
- IRMP_PARAMETER * irmp_param_p;\r
- irmp_param_p = (IRMP_PARAMETER *) 0;\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
+ }\r
+ }\r
+ else\r
+ { // receiving first data pulse!\r
+ IRMP_PARAMETER * irmp_param_p;\r
+ irmp_param_p = (IRMP_PARAMETER *) 0;\r
\r
#if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)\r
- irmp_param2.protocol = 0;\r
+ irmp_param2.protocol = 0;\r
#endif\r
\r
#ifdef ANALYZE\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
+ ANALYZE_PRINTF ("%8.3fms [start-bit: pulse = %2d, pause = %2d]\n", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_pulse_time, irmp_pause_time);\r
#endif // ANALYZE\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_pause_time >= SIRCS_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= SIRCS_START_BIT_PAUSE_LEN_MAX)\r
- { // it's SIRCS\r
+ if (irmp_pulse_time >= SIRCS_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= SIRCS_START_BIT_PULSE_LEN_MAX &&\r
+ irmp_pause_time >= SIRCS_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= SIRCS_START_BIT_PAUSE_LEN_MAX)\r
+ { // it's SIRCS\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("protocol = SIRCS, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- SIRCS_START_BIT_PULSE_LEN_MIN, SIRCS_START_BIT_PULSE_LEN_MAX,\r
- SIRCS_START_BIT_PAUSE_LEN_MIN, SIRCS_START_BIT_PAUSE_LEN_MAX);\r
+ ANALYZE_PRINTF ("protocol = SIRCS, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ SIRCS_START_BIT_PULSE_LEN_MIN, SIRCS_START_BIT_PULSE_LEN_MAX,\r
+ SIRCS_START_BIT_PAUSE_LEN_MIN, SIRCS_START_BIT_PAUSE_LEN_MAX);\r
#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &sircs_param;\r
- }\r
- else\r
+ irmp_param_p = (IRMP_PARAMETER *) &sircs_param;\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_SIRCS_PROTOCOL == 1\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 >= 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
-#ifdef ANALYZE\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
-#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &nec_param;\r
- }\r
- else\r
+ if (irmp_protocol == IRMP_JVC_PROTOCOL && // last protocol was JVC, awaiting repeat frame\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
+#ifdef ANALYZE\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
+#endif // ANALYZE\r
+ irmp_param_p = (IRMP_PARAMETER *) &nec_param;\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_JVC_PROTOCOL == 1\r
\r
#if IRMP_SUPPORT_NEC_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_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
#ifdef ANALYZE\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
+ 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
#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &nec42_param;\r
+ irmp_param_p = (IRMP_PARAMETER *) &nec42_param;\r
#else\r
#ifdef ANALYZE\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
+ 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
#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &nec_param;\r
+ irmp_param_p = (IRMP_PARAMETER *) &nec_param;\r
#endif\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
+ }\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
#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
+ 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
#ifdef ANALYZE\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
+ 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
#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &nec_param;\r
- }\r
- else\r
+ irmp_param_p = (IRMP_PARAMETER *) &nec_param;\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_JVC_PROTOCOL == 1\r
- {\r
+ {\r
#ifdef ANALYZE\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
+ 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
#endif // ANALYZE\r
\r
- irmp_param_p = (IRMP_PARAMETER *) &nec_rep_param;\r
- }\r
- }\r
- else\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
-#ifdef ANALYZE\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
-#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &nec_param;\r
- }\r
- else\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
+#ifdef ANALYZE\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
+#endif // ANALYZE\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_TELEFUNKEN_PROTOCOL == 1\r
- if (irmp_pulse_time >= TELEFUNKEN_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= TELEFUNKEN_START_BIT_PULSE_LEN_MAX &&\r
- irmp_pause_time >= TELEFUNKEN_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= TELEFUNKEN_START_BIT_PAUSE_LEN_MAX)\r
- {\r
+ if (irmp_pulse_time >= TELEFUNKEN_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= TELEFUNKEN_START_BIT_PULSE_LEN_MAX &&\r
+ irmp_pause_time >= TELEFUNKEN_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= TELEFUNKEN_START_BIT_PAUSE_LEN_MAX)\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("protocol = TELEFUNKEN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- TELEFUNKEN_START_BIT_PULSE_LEN_MIN, TELEFUNKEN_START_BIT_PULSE_LEN_MAX,\r
- TELEFUNKEN_START_BIT_PAUSE_LEN_MIN, TELEFUNKEN_START_BIT_PAUSE_LEN_MAX);\r
+ ANALYZE_PRINTF ("protocol = TELEFUNKEN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ TELEFUNKEN_START_BIT_PULSE_LEN_MIN, TELEFUNKEN_START_BIT_PULSE_LEN_MAX,\r
+ TELEFUNKEN_START_BIT_PAUSE_LEN_MIN, TELEFUNKEN_START_BIT_PAUSE_LEN_MAX);\r
#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &telefunken_param;\r
- }\r
- else\r
+ irmp_param_p = (IRMP_PARAMETER *) &telefunken_param;\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1\r
\r
#if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1\r
- if (irmp_pulse_time >= ROOMBA_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= ROOMBA_START_BIT_PULSE_LEN_MAX &&\r
- irmp_pause_time >= ROOMBA_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= ROOMBA_START_BIT_PAUSE_LEN_MAX)\r
- {\r
+ if (irmp_pulse_time >= ROOMBA_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= ROOMBA_START_BIT_PULSE_LEN_MAX &&\r
+ irmp_pause_time >= ROOMBA_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= ROOMBA_START_BIT_PAUSE_LEN_MAX)\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("protocol = ROOMBA, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- ROOMBA_START_BIT_PULSE_LEN_MIN, ROOMBA_START_BIT_PULSE_LEN_MAX,\r
- ROOMBA_START_BIT_PAUSE_LEN_MIN, ROOMBA_START_BIT_PAUSE_LEN_MAX);\r
+ ANALYZE_PRINTF ("protocol = ROOMBA, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ ROOMBA_START_BIT_PULSE_LEN_MIN, ROOMBA_START_BIT_PULSE_LEN_MAX,\r
+ ROOMBA_START_BIT_PAUSE_LEN_MIN, ROOMBA_START_BIT_PAUSE_LEN_MAX);\r
#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &roomba_param;\r
- }\r
- else\r
+ irmp_param_p = (IRMP_PARAMETER *) &roomba_param;\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_ROOMBA_PROTOCOL == 1\r
\r
#if IRMP_SUPPORT_ACP24_PROTOCOL == 1\r
- if (irmp_pulse_time >= ACP24_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= ACP24_START_BIT_PULSE_LEN_MAX &&\r
- irmp_pause_time >= ACP24_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= ACP24_START_BIT_PAUSE_LEN_MAX)\r
- {\r
+ if (irmp_pulse_time >= ACP24_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= ACP24_START_BIT_PULSE_LEN_MAX &&\r
+ irmp_pause_time >= ACP24_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= ACP24_START_BIT_PAUSE_LEN_MAX)\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("protocol = ACP24, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- ACP24_START_BIT_PULSE_LEN_MIN, ACP24_START_BIT_PULSE_LEN_MAX,\r
- ACP24_START_BIT_PAUSE_LEN_MIN, ACP24_START_BIT_PAUSE_LEN_MAX);\r
+ ANALYZE_PRINTF ("protocol = ACP24, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ ACP24_START_BIT_PULSE_LEN_MIN, ACP24_START_BIT_PULSE_LEN_MAX,\r
+ ACP24_START_BIT_PAUSE_LEN_MIN, ACP24_START_BIT_PAUSE_LEN_MAX);\r
#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &acp24_param;\r
- }\r
- else\r
+ irmp_param_p = (IRMP_PARAMETER *) &acp24_param;\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_ROOMBA_PROTOCOL == 1\r
\r
#if IRMP_SUPPORT_PENTAX_PROTOCOL == 1\r
- if (irmp_pulse_time >= PENTAX_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= PENTAX_START_BIT_PULSE_LEN_MAX &&\r
- irmp_pause_time >= PENTAX_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= PENTAX_START_BIT_PAUSE_LEN_MAX)\r
- {\r
+ if (irmp_pulse_time >= PENTAX_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= PENTAX_START_BIT_PULSE_LEN_MAX &&\r
+ irmp_pause_time >= PENTAX_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= PENTAX_START_BIT_PAUSE_LEN_MAX)\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("protocol = PENTAX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- PENTAX_START_BIT_PULSE_LEN_MIN, PENTAX_START_BIT_PULSE_LEN_MAX,\r
- PENTAX_START_BIT_PAUSE_LEN_MIN, PENTAX_START_BIT_PAUSE_LEN_MAX);\r
+ ANALYZE_PRINTF ("protocol = PENTAX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ PENTAX_START_BIT_PULSE_LEN_MIN, PENTAX_START_BIT_PULSE_LEN_MAX,\r
+ PENTAX_START_BIT_PAUSE_LEN_MIN, PENTAX_START_BIT_PAUSE_LEN_MAX);\r
#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &pentax_param;\r
- }\r
- else\r
+ irmp_param_p = (IRMP_PARAMETER *) &pentax_param;\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_PENTAX_PROTOCOL == 1\r
\r
#if IRMP_SUPPORT_NIKON_PROTOCOL == 1\r
- if (irmp_pulse_time >= NIKON_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= NIKON_START_BIT_PULSE_LEN_MAX &&\r
- irmp_pause_time >= NIKON_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= NIKON_START_BIT_PAUSE_LEN_MAX)\r
- {\r
+ if (irmp_pulse_time >= NIKON_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= NIKON_START_BIT_PULSE_LEN_MAX &&\r
+ irmp_pause_time >= NIKON_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= NIKON_START_BIT_PAUSE_LEN_MAX)\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("protocol = NIKON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- NIKON_START_BIT_PULSE_LEN_MIN, NIKON_START_BIT_PULSE_LEN_MAX,\r
- NIKON_START_BIT_PAUSE_LEN_MIN, NIKON_START_BIT_PAUSE_LEN_MAX);\r
+ ANALYZE_PRINTF ("protocol = NIKON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ NIKON_START_BIT_PULSE_LEN_MIN, NIKON_START_BIT_PULSE_LEN_MAX,\r
+ NIKON_START_BIT_PAUSE_LEN_MIN, NIKON_START_BIT_PAUSE_LEN_MAX);\r
#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &nikon_param;\r
- }\r
- else\r
+ irmp_param_p = (IRMP_PARAMETER *) &nikon_param;\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_NIKON_PROTOCOL == 1\r
\r
#if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1\r
- if (irmp_pulse_time >= SAMSUNG_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= SAMSUNG_START_BIT_PULSE_LEN_MAX &&\r
- irmp_pause_time >= SAMSUNG_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= SAMSUNG_START_BIT_PAUSE_LEN_MAX)\r
- { // it's SAMSUNG\r
+ if (irmp_pulse_time >= SAMSUNG_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= SAMSUNG_START_BIT_PULSE_LEN_MAX &&\r
+ irmp_pause_time >= SAMSUNG_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= SAMSUNG_START_BIT_PAUSE_LEN_MAX)\r
+ { // it's SAMSUNG\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("protocol = SAMSUNG, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- SAMSUNG_START_BIT_PULSE_LEN_MIN, SAMSUNG_START_BIT_PULSE_LEN_MAX,\r
- SAMSUNG_START_BIT_PAUSE_LEN_MIN, SAMSUNG_START_BIT_PAUSE_LEN_MAX);\r
+ ANALYZE_PRINTF ("protocol = SAMSUNG, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ SAMSUNG_START_BIT_PULSE_LEN_MIN, SAMSUNG_START_BIT_PULSE_LEN_MAX,\r
+ SAMSUNG_START_BIT_PAUSE_LEN_MIN, SAMSUNG_START_BIT_PAUSE_LEN_MAX);\r
#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &samsung_param;\r
- }\r
- else\r
+ irmp_param_p = (IRMP_PARAMETER *) &samsung_param;\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1\r
\r
#if IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1\r
- if (irmp_pulse_time >= MATSUSHITA_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= MATSUSHITA_START_BIT_PULSE_LEN_MAX &&\r
- irmp_pause_time >= MATSUSHITA_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= MATSUSHITA_START_BIT_PAUSE_LEN_MAX)\r
- { // it's MATSUSHITA\r
+ if (irmp_pulse_time >= MATSUSHITA_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= MATSUSHITA_START_BIT_PULSE_LEN_MAX &&\r
+ irmp_pause_time >= MATSUSHITA_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= MATSUSHITA_START_BIT_PAUSE_LEN_MAX)\r
+ { // it's MATSUSHITA\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("protocol = MATSUSHITA, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- MATSUSHITA_START_BIT_PULSE_LEN_MIN, MATSUSHITA_START_BIT_PULSE_LEN_MAX,\r
- MATSUSHITA_START_BIT_PAUSE_LEN_MIN, MATSUSHITA_START_BIT_PAUSE_LEN_MAX);\r
+ ANALYZE_PRINTF ("protocol = MATSUSHITA, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ MATSUSHITA_START_BIT_PULSE_LEN_MIN, MATSUSHITA_START_BIT_PULSE_LEN_MAX,\r
+ MATSUSHITA_START_BIT_PAUSE_LEN_MIN, MATSUSHITA_START_BIT_PAUSE_LEN_MAX);\r
#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &matsushita_param;\r
- }\r
- else\r
+ irmp_param_p = (IRMP_PARAMETER *) &matsushita_param;\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1\r
\r
#if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1\r
- if (irmp_pulse_time >= KASEIKYO_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= KASEIKYO_START_BIT_PULSE_LEN_MAX &&\r
- irmp_pause_time >= KASEIKYO_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= KASEIKYO_START_BIT_PAUSE_LEN_MAX)\r
- { // it's KASEIKYO\r
+ if (irmp_pulse_time >= KASEIKYO_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= KASEIKYO_START_BIT_PULSE_LEN_MAX &&\r
+ irmp_pause_time >= KASEIKYO_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= KASEIKYO_START_BIT_PAUSE_LEN_MAX)\r
+ { // it's KASEIKYO\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("protocol = KASEIKYO, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- KASEIKYO_START_BIT_PULSE_LEN_MIN, KASEIKYO_START_BIT_PULSE_LEN_MAX,\r
- KASEIKYO_START_BIT_PAUSE_LEN_MIN, KASEIKYO_START_BIT_PAUSE_LEN_MAX);\r
+ ANALYZE_PRINTF ("protocol = KASEIKYO, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ KASEIKYO_START_BIT_PULSE_LEN_MIN, KASEIKYO_START_BIT_PULSE_LEN_MAX,\r
+ KASEIKYO_START_BIT_PAUSE_LEN_MIN, KASEIKYO_START_BIT_PAUSE_LEN_MAX);\r
#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &kaseikyo_param;\r
- }\r
- else\r
+ irmp_param_p = (IRMP_PARAMETER *) &kaseikyo_param;\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1\r
\r
#if IRMP_SUPPORT_PANASONIC_PROTOCOL == 1\r
- if (irmp_pulse_time >= PANASONIC_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= PANASONIC_START_BIT_PULSE_LEN_MAX &&\r
- irmp_pause_time >= PANASONIC_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= PANASONIC_START_BIT_PAUSE_LEN_MAX)\r
- { // it's PANASONIC\r
+ if (irmp_pulse_time >= PANASONIC_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= PANASONIC_START_BIT_PULSE_LEN_MAX &&\r
+ irmp_pause_time >= PANASONIC_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= PANASONIC_START_BIT_PAUSE_LEN_MAX)\r
+ { // it's PANASONIC\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("protocol = PANASONIC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- PANASONIC_START_BIT_PULSE_LEN_MIN, PANASONIC_START_BIT_PULSE_LEN_MAX,\r
- PANASONIC_START_BIT_PAUSE_LEN_MIN, PANASONIC_START_BIT_PAUSE_LEN_MAX);\r
+ ANALYZE_PRINTF ("protocol = PANASONIC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ PANASONIC_START_BIT_PULSE_LEN_MIN, PANASONIC_START_BIT_PULSE_LEN_MAX,\r
+ PANASONIC_START_BIT_PAUSE_LEN_MIN, PANASONIC_START_BIT_PAUSE_LEN_MAX);\r
#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &panasonic_param;\r
- }\r
- else\r
+ irmp_param_p = (IRMP_PARAMETER *) &panasonic_param;\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_PANASONIC_PROTOCOL == 1\r
\r
#if IRMP_SUPPORT_RADIO1_PROTOCOL == 1\r
- if (irmp_pulse_time >= RADIO1_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= RADIO1_START_BIT_PULSE_LEN_MAX &&\r
- irmp_pause_time >= RADIO1_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= RADIO1_START_BIT_PAUSE_LEN_MAX)\r
- {\r
+ if (irmp_pulse_time >= RADIO1_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= RADIO1_START_BIT_PULSE_LEN_MAX &&\r
+ irmp_pause_time >= RADIO1_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= RADIO1_START_BIT_PAUSE_LEN_MAX)\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("protocol = RADIO1, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- RADIO1_START_BIT_PULSE_LEN_MIN, RADIO1_START_BIT_PULSE_LEN_MAX,\r
- RADIO1_START_BIT_PAUSE_LEN_MIN, RADIO1_START_BIT_PAUSE_LEN_MAX);\r
+ ANALYZE_PRINTF ("protocol = RADIO1, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ RADIO1_START_BIT_PULSE_LEN_MIN, RADIO1_START_BIT_PULSE_LEN_MAX,\r
+ RADIO1_START_BIT_PAUSE_LEN_MIN, RADIO1_START_BIT_PAUSE_LEN_MAX);\r
#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &radio1_param;\r
- }\r
- else\r
+ irmp_param_p = (IRMP_PARAMETER *) &radio1_param;\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_RRADIO1_PROTOCOL == 1\r
\r
#if IRMP_SUPPORT_RECS80_PROTOCOL == 1\r
- if (irmp_pulse_time >= RECS80_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= RECS80_START_BIT_PULSE_LEN_MAX &&\r
- irmp_pause_time >= RECS80_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= RECS80_START_BIT_PAUSE_LEN_MAX)\r
- { // it's RECS80\r
+ if (irmp_pulse_time >= RECS80_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= RECS80_START_BIT_PULSE_LEN_MAX &&\r
+ irmp_pause_time >= RECS80_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= RECS80_START_BIT_PAUSE_LEN_MAX)\r
+ { // it's RECS80\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("protocol = RECS80, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- RECS80_START_BIT_PULSE_LEN_MIN, RECS80_START_BIT_PULSE_LEN_MAX,\r
- RECS80_START_BIT_PAUSE_LEN_MIN, RECS80_START_BIT_PAUSE_LEN_MAX);\r
+ ANALYZE_PRINTF ("protocol = RECS80, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ RECS80_START_BIT_PULSE_LEN_MIN, RECS80_START_BIT_PULSE_LEN_MAX,\r
+ RECS80_START_BIT_PAUSE_LEN_MIN, RECS80_START_BIT_PAUSE_LEN_MAX);\r
#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &recs80_param;\r
- }\r
- else\r
+ irmp_param_p = (IRMP_PARAMETER *) &recs80_param;\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_RECS80_PROTOCOL == 1\r
\r
#if IRMP_SUPPORT_S100_PROTOCOL == 1\r
- if (((irmp_pulse_time >= S100_START_BIT_LEN_MIN && irmp_pulse_time <= S100_START_BIT_LEN_MAX) ||\r
- (irmp_pulse_time >= 2 * S100_START_BIT_LEN_MIN && irmp_pulse_time <= 2 * S100_START_BIT_LEN_MAX)) &&\r
- ((irmp_pause_time >= S100_START_BIT_LEN_MIN && irmp_pause_time <= S100_START_BIT_LEN_MAX) ||\r
- (irmp_pause_time >= 2 * S100_START_BIT_LEN_MIN && irmp_pause_time <= 2 * S100_START_BIT_LEN_MAX)))\r
- { // it's S100\r
-#ifdef ANALYZE\r
- ANALYZE_PRINTF ("protocol = S100, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or pulse: %3d - %3d, pause: %3d - %3d\n",\r
- S100_START_BIT_LEN_MIN, S100_START_BIT_LEN_MAX,\r
- 2 * S100_START_BIT_LEN_MIN, 2 * S100_START_BIT_LEN_MAX,\r
- S100_START_BIT_LEN_MIN, S100_START_BIT_LEN_MAX,\r
- 2 * S100_START_BIT_LEN_MIN, 2 * S100_START_BIT_LEN_MAX);\r
-#endif // ANALYZE\r
-\r
- irmp_param_p = (IRMP_PARAMETER *) &s100_param;\r
- last_pause = irmp_pause_time;\r
-\r
- if ((irmp_pulse_time > S100_START_BIT_LEN_MAX && irmp_pulse_time <= 2 * S100_START_BIT_LEN_MAX) ||\r
- (irmp_pause_time > S100_START_BIT_LEN_MAX && irmp_pause_time <= 2 * S100_START_BIT_LEN_MAX))\r
- {\r
- last_value = 0;\r
- rc5_cmd_bit6 = 1<<6;\r
- }\r
- else\r
- {\r
- last_value = 1;\r
- }\r
- }\r
- else\r
+ if (((irmp_pulse_time >= S100_START_BIT_LEN_MIN && irmp_pulse_time <= S100_START_BIT_LEN_MAX) ||\r
+ (irmp_pulse_time >= 2 * S100_START_BIT_LEN_MIN && irmp_pulse_time <= 2 * S100_START_BIT_LEN_MAX)) &&\r
+ ((irmp_pause_time >= S100_START_BIT_LEN_MIN && irmp_pause_time <= S100_START_BIT_LEN_MAX) ||\r
+ (irmp_pause_time >= 2 * S100_START_BIT_LEN_MIN && irmp_pause_time <= 2 * S100_START_BIT_LEN_MAX)))\r
+ { // it's S100\r
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("protocol = S100, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ S100_START_BIT_LEN_MIN, S100_START_BIT_LEN_MAX,\r
+ 2 * S100_START_BIT_LEN_MIN, 2 * S100_START_BIT_LEN_MAX,\r
+ S100_START_BIT_LEN_MIN, S100_START_BIT_LEN_MAX,\r
+ 2 * S100_START_BIT_LEN_MIN, 2 * S100_START_BIT_LEN_MAX);\r
+#endif // ANALYZE\r
+\r
+ irmp_param_p = (IRMP_PARAMETER *) &s100_param;\r
+ last_pause = irmp_pause_time;\r
+\r
+ if ((irmp_pulse_time > S100_START_BIT_LEN_MAX && irmp_pulse_time <= 2 * S100_START_BIT_LEN_MAX) ||\r
+ (irmp_pause_time > S100_START_BIT_LEN_MAX && irmp_pause_time <= 2 * S100_START_BIT_LEN_MAX))\r
+ {\r
+ last_value = 0;\r
+ rc5_cmd_bit6 = 1<<6;\r
+ }\r
+ else\r
+ {\r
+ last_value = 1;\r
+ }\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_S100_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
- (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 >= 2 * RC5_START_BIT_LEN_MIN && irmp_pause_time <= 2 * RC5_START_BIT_LEN_MAX)))\r
- { // it's RC5\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 >= 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
- 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
-#ifdef ANALYZE\r
- ANALYZE_PRINTF ("protocol = RC5 or FDC\n");\r
- ANALYZE_PRINTF ("FDC start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- FDC_START_BIT_PULSE_LEN_MIN, FDC_START_BIT_PULSE_LEN_MAX,\r
- FDC_START_BIT_PAUSE_LEN_MIN, FDC_START_BIT_PAUSE_LEN_MAX);\r
- ANALYZE_PRINTF ("RC5 start bit timings: 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
-#endif // ANALYZE\r
- memcpy_P (&irmp_param2, &fdc_param, sizeof (IRMP_PARAMETER));\r
- }\r
- else\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
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("protocol = RC5 or FDC\n");\r
+ ANALYZE_PRINTF ("FDC start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ FDC_START_BIT_PULSE_LEN_MIN, FDC_START_BIT_PULSE_LEN_MAX,\r
+ FDC_START_BIT_PAUSE_LEN_MIN, FDC_START_BIT_PAUSE_LEN_MAX);\r
+ ANALYZE_PRINTF ("RC5 start bit timings: 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
+#endif // ANALYZE\r
+ memcpy_P (&irmp_param2, &fdc_param, sizeof (IRMP_PARAMETER));\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
-#ifdef ANALYZE\r
- ANALYZE_PRINTF ("protocol = RC5 or RCCAR\n");\r
- ANALYZE_PRINTF ("RCCAR start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- RCCAR_START_BIT_PULSE_LEN_MIN, RCCAR_START_BIT_PULSE_LEN_MAX,\r
- RCCAR_START_BIT_PAUSE_LEN_MIN, RCCAR_START_BIT_PAUSE_LEN_MAX);\r
- ANALYZE_PRINTF ("RC5 start bit timings: 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
-#endif // ANALYZE\r
- memcpy_P (&irmp_param2, &rccar_param, sizeof (IRMP_PARAMETER));\r
- }\r
- else\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
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("protocol = RC5 or RCCAR\n");\r
+ ANALYZE_PRINTF ("RCCAR start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ RCCAR_START_BIT_PULSE_LEN_MIN, RCCAR_START_BIT_PULSE_LEN_MAX,\r
+ RCCAR_START_BIT_PAUSE_LEN_MIN, RCCAR_START_BIT_PAUSE_LEN_MAX);\r
+ ANALYZE_PRINTF ("RC5 start bit timings: 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
+#endif // ANALYZE\r
+ memcpy_P (&irmp_param2, &rccar_param, sizeof (IRMP_PARAMETER));\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1\r
- {\r
-#ifdef ANALYZE\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
- 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
-#endif // ANALYZE\r
- }\r
-\r
- irmp_param_p = (IRMP_PARAMETER *) &rc5_param;\r
- last_pause = irmp_pause_time;\r
-\r
- if ((irmp_pulse_time > RC5_START_BIT_LEN_MAX && irmp_pulse_time <= 2 * RC5_START_BIT_LEN_MAX) ||\r
- (irmp_pause_time > RC5_START_BIT_LEN_MAX && irmp_pause_time <= 2 * RC5_START_BIT_LEN_MAX))\r
- {\r
- last_value = 0;\r
- rc5_cmd_bit6 = 1<<6;\r
- }\r
- else\r
- {\r
- last_value = 1;\r
- }\r
- }\r
- else\r
+ {\r
+#ifdef ANALYZE\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
+ 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
+#endif // ANALYZE\r
+ }\r
+\r
+ irmp_param_p = (IRMP_PARAMETER *) &rc5_param;\r
+ last_pause = irmp_pause_time;\r
+\r
+ if ((irmp_pulse_time > RC5_START_BIT_LEN_MAX && irmp_pulse_time <= 2 * RC5_START_BIT_LEN_MAX) ||\r
+ (irmp_pause_time > RC5_START_BIT_LEN_MAX && irmp_pause_time <= 2 * RC5_START_BIT_LEN_MAX))\r
+ {\r
+ last_value = 0;\r
+ rc5_cmd_bit6 = 1<<6;\r
+ }\r
+ else\r
+ {\r
+ last_value = 1;\r
+ }\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_RC5_PROTOCOL == 1\r
\r
#if IRMP_SUPPORT_DENON_PROTOCOL == 1\r
- if ( (irmp_pulse_time >= DENON_PULSE_LEN_MIN && irmp_pulse_time <= DENON_PULSE_LEN_MAX) &&\r
- ((irmp_pause_time >= DENON_1_PAUSE_LEN_MIN && irmp_pause_time <= DENON_1_PAUSE_LEN_MAX) ||\r
- (irmp_pause_time >= DENON_0_PAUSE_LEN_MIN && irmp_pause_time <= DENON_0_PAUSE_LEN_MAX)))\r
- { // it's DENON\r
-#ifdef ANALYZE\r
- ANALYZE_PRINTF ("protocol = DENON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or %3d - %3d\n",\r
- DENON_PULSE_LEN_MIN, DENON_PULSE_LEN_MAX,\r
- DENON_1_PAUSE_LEN_MIN, DENON_1_PAUSE_LEN_MAX,\r
- DENON_0_PAUSE_LEN_MIN, DENON_0_PAUSE_LEN_MAX);\r
-#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &denon_param;\r
- }\r
- else\r
+ if ( (irmp_pulse_time >= DENON_PULSE_LEN_MIN && irmp_pulse_time <= DENON_PULSE_LEN_MAX) &&\r
+ ((irmp_pause_time >= DENON_1_PAUSE_LEN_MIN && irmp_pause_time <= DENON_1_PAUSE_LEN_MAX) ||\r
+ (irmp_pause_time >= DENON_0_PAUSE_LEN_MIN && irmp_pause_time <= DENON_0_PAUSE_LEN_MAX)))\r
+ { // it's DENON\r
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("protocol = DENON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or %3d - %3d\n",\r
+ DENON_PULSE_LEN_MIN, DENON_PULSE_LEN_MAX,\r
+ DENON_1_PAUSE_LEN_MIN, DENON_1_PAUSE_LEN_MAX,\r
+ DENON_0_PAUSE_LEN_MIN, DENON_0_PAUSE_LEN_MAX);\r
+#endif // ANALYZE\r
+ irmp_param_p = (IRMP_PARAMETER *) &denon_param;\r
+ }\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
-#ifdef ANALYZE\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
-#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &thomson_param;\r
- }\r
- else\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
+#ifdef ANALYZE\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
+#endif // ANALYZE\r
+ irmp_param_p = (IRMP_PARAMETER *) &thomson_param;\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_THOMSON_PROTOCOL == 1\r
\r
#if IRMP_SUPPORT_BOSE_PROTOCOL == 1\r
- if (irmp_pulse_time >= BOSE_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= BOSE_START_BIT_PULSE_LEN_MAX &&\r
- irmp_pause_time >= BOSE_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= BOSE_START_BIT_PAUSE_LEN_MAX)\r
- {\r
+ if (irmp_pulse_time >= BOSE_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= BOSE_START_BIT_PULSE_LEN_MAX &&\r
+ irmp_pause_time >= BOSE_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= BOSE_START_BIT_PAUSE_LEN_MAX)\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("protocol = BOSE, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- BOSE_START_BIT_PULSE_LEN_MIN, BOSE_START_BIT_PULSE_LEN_MAX,\r
- BOSE_START_BIT_PAUSE_LEN_MIN, BOSE_START_BIT_PAUSE_LEN_MAX);\r
+ ANALYZE_PRINTF ("protocol = BOSE, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ BOSE_START_BIT_PULSE_LEN_MIN, BOSE_START_BIT_PULSE_LEN_MAX,\r
+ BOSE_START_BIT_PAUSE_LEN_MIN, BOSE_START_BIT_PAUSE_LEN_MAX);\r
#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &bose_param;\r
- }\r
- else\r
+ irmp_param_p = (IRMP_PARAMETER *) &bose_param;\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_BOSE_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
- { // it's RC6\r
-#ifdef ANALYZE\r
- ANALYZE_PRINTF ("protocol = RC6, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- RC6_START_BIT_PULSE_LEN_MIN, RC6_START_BIT_PULSE_LEN_MAX,\r
- RC6_START_BIT_PAUSE_LEN_MIN, RC6_START_BIT_PAUSE_LEN_MAX);\r
-#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &rc6_param;\r
- last_pause = 0;\r
- last_value = 1;\r
- }\r
- else\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
+ { // it's RC6\r
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("protocol = RC6, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ RC6_START_BIT_PULSE_LEN_MIN, RC6_START_BIT_PULSE_LEN_MAX,\r
+ RC6_START_BIT_PAUSE_LEN_MIN, RC6_START_BIT_PAUSE_LEN_MAX);\r
+#endif // ANALYZE\r
+ irmp_param_p = (IRMP_PARAMETER *) &rc6_param;\r
+ last_pause = 0;\r
+ last_value = 1;\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_RC6_PROTOCOL == 1\r
\r
#if IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1\r
- if (irmp_pulse_time >= RECS80EXT_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= RECS80EXT_START_BIT_PULSE_LEN_MAX &&\r
- irmp_pause_time >= RECS80EXT_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= RECS80EXT_START_BIT_PAUSE_LEN_MAX)\r
- { // it's RECS80EXT\r
+ if (irmp_pulse_time >= RECS80EXT_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= RECS80EXT_START_BIT_PULSE_LEN_MAX &&\r
+ irmp_pause_time >= RECS80EXT_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= RECS80EXT_START_BIT_PAUSE_LEN_MAX)\r
+ { // it's RECS80EXT\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("protocol = RECS80EXT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- RECS80EXT_START_BIT_PULSE_LEN_MIN, RECS80EXT_START_BIT_PULSE_LEN_MAX,\r
- RECS80EXT_START_BIT_PAUSE_LEN_MIN, RECS80EXT_START_BIT_PAUSE_LEN_MAX);\r
+ ANALYZE_PRINTF ("protocol = RECS80EXT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ RECS80EXT_START_BIT_PULSE_LEN_MIN, RECS80EXT_START_BIT_PULSE_LEN_MAX,\r
+ RECS80EXT_START_BIT_PAUSE_LEN_MIN, RECS80EXT_START_BIT_PAUSE_LEN_MAX);\r
#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &recs80ext_param;\r
- }\r
- else\r
+ irmp_param_p = (IRMP_PARAMETER *) &recs80ext_param;\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1\r
\r
#if IRMP_SUPPORT_NUBERT_PROTOCOL == 1\r
- if (irmp_pulse_time >= NUBERT_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= NUBERT_START_BIT_PULSE_LEN_MAX &&\r
- irmp_pause_time >= NUBERT_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= NUBERT_START_BIT_PAUSE_LEN_MAX)\r
- { // it's NUBERT\r
+ if (irmp_pulse_time >= NUBERT_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= NUBERT_START_BIT_PULSE_LEN_MAX &&\r
+ irmp_pause_time >= NUBERT_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= NUBERT_START_BIT_PAUSE_LEN_MAX)\r
+ { // it's NUBERT\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("protocol = NUBERT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- NUBERT_START_BIT_PULSE_LEN_MIN, NUBERT_START_BIT_PULSE_LEN_MAX,\r
- NUBERT_START_BIT_PAUSE_LEN_MIN, NUBERT_START_BIT_PAUSE_LEN_MAX);\r
+ ANALYZE_PRINTF ("protocol = NUBERT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ NUBERT_START_BIT_PULSE_LEN_MIN, NUBERT_START_BIT_PULSE_LEN_MAX,\r
+ NUBERT_START_BIT_PAUSE_LEN_MIN, NUBERT_START_BIT_PAUSE_LEN_MAX);\r
#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &nubert_param;\r
- }\r
- else\r
+ irmp_param_p = (IRMP_PARAMETER *) &nubert_param;\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_NUBERT_PROTOCOL == 1\r
\r
#if IRMP_SUPPORT_FAN_PROTOCOL == 1\r
- if (irmp_pulse_time >= FAN_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= FAN_START_BIT_PULSE_LEN_MAX &&\r
- irmp_pause_time >= FAN_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= FAN_START_BIT_PAUSE_LEN_MAX)\r
- { // it's FAN\r
+ if (irmp_pulse_time >= FAN_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= FAN_START_BIT_PULSE_LEN_MAX &&\r
+ irmp_pause_time >= FAN_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= FAN_START_BIT_PAUSE_LEN_MAX)\r
+ { // it's FAN\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("protocol = FAN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- FAN_START_BIT_PULSE_LEN_MIN, FAN_START_BIT_PULSE_LEN_MAX,\r
- FAN_START_BIT_PAUSE_LEN_MIN, FAN_START_BIT_PAUSE_LEN_MAX);\r
+ ANALYZE_PRINTF ("protocol = FAN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ FAN_START_BIT_PULSE_LEN_MIN, FAN_START_BIT_PULSE_LEN_MAX,\r
+ FAN_START_BIT_PAUSE_LEN_MIN, FAN_START_BIT_PAUSE_LEN_MAX);\r
#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &fan_param;\r
- }\r
- else\r
+ irmp_param_p = (IRMP_PARAMETER *) &fan_param;\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_FAN_PROTOCOL == 1\r
\r
#if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1\r
- if (irmp_pulse_time >= SPEAKER_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= SPEAKER_START_BIT_PULSE_LEN_MAX &&\r
- irmp_pause_time >= SPEAKER_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= SPEAKER_START_BIT_PAUSE_LEN_MAX)\r
- { // it's SPEAKER\r
+ if (irmp_pulse_time >= SPEAKER_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= SPEAKER_START_BIT_PULSE_LEN_MAX &&\r
+ irmp_pause_time >= SPEAKER_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= SPEAKER_START_BIT_PAUSE_LEN_MAX)\r
+ { // it's SPEAKER\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("protocol = SPEAKER, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- SPEAKER_START_BIT_PULSE_LEN_MIN, SPEAKER_START_BIT_PULSE_LEN_MAX,\r
- SPEAKER_START_BIT_PAUSE_LEN_MIN, SPEAKER_START_BIT_PAUSE_LEN_MAX);\r
+ ANALYZE_PRINTF ("protocol = SPEAKER, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ SPEAKER_START_BIT_PULSE_LEN_MIN, SPEAKER_START_BIT_PULSE_LEN_MAX,\r
+ SPEAKER_START_BIT_PAUSE_LEN_MIN, SPEAKER_START_BIT_PAUSE_LEN_MAX);\r
#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &speaker_param;\r
- }\r
- else\r
+ irmp_param_p = (IRMP_PARAMETER *) &speaker_param;\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_SPEAKER_PROTOCOL == 1\r
\r
#if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1\r
- if (irmp_pulse_time >= BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN && irmp_pulse_time <= BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX &&\r
- irmp_pause_time >= BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN && irmp_pause_time <= BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX)\r
- { // it's BANG_OLUFSEN\r
-#ifdef ANALYZE\r
- ANALYZE_PRINTF ("protocol = BANG_OLUFSEN\n");\r
- ANALYZE_PRINTF ("start bit 1 timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN, BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX,\r
- BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN, BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX);\r
- ANALYZE_PRINTF ("start bit 2 timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- BANG_OLUFSEN_START_BIT2_PULSE_LEN_MIN, BANG_OLUFSEN_START_BIT2_PULSE_LEN_MAX,\r
- BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MIN, BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MAX);\r
- ANALYZE_PRINTF ("start bit 3 timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- BANG_OLUFSEN_START_BIT3_PULSE_LEN_MIN, BANG_OLUFSEN_START_BIT3_PULSE_LEN_MAX,\r
- BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN, BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX);\r
- ANALYZE_PRINTF ("start bit 4 timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- BANG_OLUFSEN_START_BIT4_PULSE_LEN_MIN, BANG_OLUFSEN_START_BIT4_PULSE_LEN_MAX,\r
- BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MIN, BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MAX);\r
-#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &bang_olufsen_param;\r
- last_value = 0;\r
- }\r
- else\r
+ if (irmp_pulse_time >= BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN && irmp_pulse_time <= BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX &&\r
+ irmp_pause_time >= BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN && irmp_pause_time <= BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX)\r
+ { // it's BANG_OLUFSEN\r
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("protocol = BANG_OLUFSEN\n");\r
+ ANALYZE_PRINTF ("start bit 1 timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN, BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX,\r
+ BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN, BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX);\r
+ ANALYZE_PRINTF ("start bit 2 timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ BANG_OLUFSEN_START_BIT2_PULSE_LEN_MIN, BANG_OLUFSEN_START_BIT2_PULSE_LEN_MAX,\r
+ BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MIN, BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MAX);\r
+ ANALYZE_PRINTF ("start bit 3 timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ BANG_OLUFSEN_START_BIT3_PULSE_LEN_MIN, BANG_OLUFSEN_START_BIT3_PULSE_LEN_MAX,\r
+ BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN, BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX);\r
+ ANALYZE_PRINTF ("start bit 4 timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ BANG_OLUFSEN_START_BIT4_PULSE_LEN_MIN, BANG_OLUFSEN_START_BIT4_PULSE_LEN_MAX,\r
+ BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MIN, BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MAX);\r
+#endif // ANALYZE\r
+ irmp_param_p = (IRMP_PARAMETER *) &bang_olufsen_param;\r
+ last_value = 0;\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1\r
\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
-#ifdef ANALYZE\r
- ANALYZE_PRINTF ("protocol = GRUNDIG, pre bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\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
-#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &grundig_param;\r
- last_pause = irmp_pause_time;\r
- last_value = 1;\r
- }\r
- else\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
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("protocol = GRUNDIG, pre bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\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
+#endif // ANALYZE\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_NOKIA_IR60_PROTOCOL == 1\r
\r
#if IRMP_SUPPORT_MERLIN_PROTOCOL == 1 // check MERLIN before RUWIDO!\r
- if (irmp_pulse_time >= MERLIN_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= MERLIN_START_BIT_PULSE_LEN_MAX &&\r
- irmp_pause_time >= MERLIN_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= MERLIN_START_BIT_PAUSE_LEN_MAX)\r
- { // it's MERLIN\r
-#ifdef ANALYZE\r
- ANALYZE_PRINTF ("protocol = MERLIN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- MERLIN_START_BIT_PULSE_LEN_MIN, MERLIN_START_BIT_PULSE_LEN_MAX,\r
- MERLIN_START_BIT_PAUSE_LEN_MIN, MERLIN_START_BIT_PAUSE_LEN_MAX);\r
-#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &merlin_param;\r
- last_pause = 0;\r
- last_value = 1;\r
- }\r
- else\r
+ if (irmp_pulse_time >= MERLIN_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= MERLIN_START_BIT_PULSE_LEN_MAX &&\r
+ irmp_pause_time >= MERLIN_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= MERLIN_START_BIT_PAUSE_LEN_MAX)\r
+ { // it's MERLIN\r
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("protocol = MERLIN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ MERLIN_START_BIT_PULSE_LEN_MIN, MERLIN_START_BIT_PULSE_LEN_MAX,\r
+ MERLIN_START_BIT_PAUSE_LEN_MIN, MERLIN_START_BIT_PAUSE_LEN_MAX);\r
+#endif // ANALYZE\r
+ irmp_param_p = (IRMP_PARAMETER *) &merlin_param;\r
+ last_pause = 0;\r
+ last_value = 1;\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_MERLIN_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
-#ifdef ANALYZE\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
-#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &ruwido_param;\r
- last_pause = irmp_pause_time;\r
- last_value = 1;\r
- }\r
- else\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
+#ifdef ANALYZE\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
+#endif // ANALYZE\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_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
+ 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
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("protocol = FDC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- FDC_START_BIT_PULSE_LEN_MIN, FDC_START_BIT_PULSE_LEN_MAX,\r
- FDC_START_BIT_PAUSE_LEN_MIN, FDC_START_BIT_PAUSE_LEN_MAX);\r
+ ANALYZE_PRINTF ("protocol = FDC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ FDC_START_BIT_PULSE_LEN_MIN, FDC_START_BIT_PULSE_LEN_MAX,\r
+ FDC_START_BIT_PAUSE_LEN_MIN, FDC_START_BIT_PAUSE_LEN_MAX);\r
#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &fdc_param;\r
- }\r
- else\r
+ irmp_param_p = (IRMP_PARAMETER *) &fdc_param;\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
+ 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
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("protocol = RCCAR, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- RCCAR_START_BIT_PULSE_LEN_MIN, RCCAR_START_BIT_PULSE_LEN_MAX,\r
- RCCAR_START_BIT_PAUSE_LEN_MIN, RCCAR_START_BIT_PAUSE_LEN_MAX);\r
+ ANALYZE_PRINTF ("protocol = RCCAR, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ RCCAR_START_BIT_PULSE_LEN_MIN, RCCAR_START_BIT_PULSE_LEN_MAX,\r
+ RCCAR_START_BIT_PAUSE_LEN_MIN, RCCAR_START_BIT_PAUSE_LEN_MAX);\r
#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &rccar_param;\r
- }\r
- else\r
+ irmp_param_p = (IRMP_PARAMETER *) &rccar_param;\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
+ 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
#ifdef ANALYZE\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
+ 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
#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &kathrein_param;\r
- }\r
- else\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
+ 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
#ifdef ANALYZE\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
+ 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
#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &netbox_param;\r
- }\r
- else\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
+ 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
#ifdef ANALYZE\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
+ 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
#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &lego_param;\r
- }\r
- else\r
+ irmp_param_p = (IRMP_PARAMETER *) &lego_param;\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_LEGO_PROTOCOL == 1\r
\r
#if IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1\r
- if (irmp_pulse_time >= A1TVBOX_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= A1TVBOX_START_BIT_PULSE_LEN_MAX &&\r
- irmp_pause_time >= A1TVBOX_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= A1TVBOX_START_BIT_PAUSE_LEN_MAX)\r
- { // it's A1TVBOX\r
-#ifdef ANALYZE\r
- ANALYZE_PRINTF ("protocol = A1TVBOX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- A1TVBOX_START_BIT_PULSE_LEN_MIN, A1TVBOX_START_BIT_PULSE_LEN_MAX,\r
- A1TVBOX_START_BIT_PAUSE_LEN_MIN, A1TVBOX_START_BIT_PAUSE_LEN_MAX);\r
-#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &a1tvbox_param;\r
- last_pause = 0;\r
- last_value = 1;\r
- }\r
- else\r
+ if (irmp_pulse_time >= A1TVBOX_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= A1TVBOX_START_BIT_PULSE_LEN_MAX &&\r
+ irmp_pause_time >= A1TVBOX_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= A1TVBOX_START_BIT_PAUSE_LEN_MAX)\r
+ { // it's A1TVBOX\r
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("protocol = A1TVBOX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ A1TVBOX_START_BIT_PULSE_LEN_MIN, A1TVBOX_START_BIT_PULSE_LEN_MAX,\r
+ A1TVBOX_START_BIT_PAUSE_LEN_MIN, A1TVBOX_START_BIT_PAUSE_LEN_MAX);\r
+#endif // ANALYZE\r
+ irmp_param_p = (IRMP_PARAMETER *) &a1tvbox_param;\r
+ last_pause = 0;\r
+ last_value = 1;\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1\r
\r
#if IRMP_SUPPORT_ORTEK_PROTOCOL == 1\r
- if (irmp_pulse_time >= ORTEK_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= ORTEK_START_BIT_PULSE_LEN_MAX &&\r
- irmp_pause_time >= ORTEK_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= ORTEK_START_BIT_PAUSE_LEN_MAX)\r
- { // it's ORTEK (Hama)\r
-#ifdef ANALYZE\r
- ANALYZE_PRINTF ("protocol = ORTEK, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- ORTEK_START_BIT_PULSE_LEN_MIN, ORTEK_START_BIT_PULSE_LEN_MAX,\r
- ORTEK_START_BIT_PAUSE_LEN_MIN, ORTEK_START_BIT_PAUSE_LEN_MAX);\r
-#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &ortek_param;\r
- last_pause = 0;\r
- last_value = 1;\r
- parity = 0;\r
- }\r
- else\r
+ if (irmp_pulse_time >= ORTEK_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= ORTEK_START_BIT_PULSE_LEN_MAX &&\r
+ irmp_pause_time >= ORTEK_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= ORTEK_START_BIT_PAUSE_LEN_MAX)\r
+ { // it's ORTEK (Hama)\r
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("protocol = ORTEK, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ ORTEK_START_BIT_PULSE_LEN_MIN, ORTEK_START_BIT_PULSE_LEN_MAX,\r
+ ORTEK_START_BIT_PAUSE_LEN_MIN, ORTEK_START_BIT_PAUSE_LEN_MAX);\r
+#endif // ANALYZE\r
+ irmp_param_p = (IRMP_PARAMETER *) &ortek_param;\r
+ last_pause = 0;\r
+ last_value = 1;\r
+ parity = 0;\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_ORTEK_PROTOCOL == 1\r
\r
#if IRMP_SUPPORT_RCMM_PROTOCOL == 1\r
- if (irmp_pulse_time >= RCMM32_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= RCMM32_START_BIT_PULSE_LEN_MAX &&\r
- irmp_pause_time >= RCMM32_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= RCMM32_START_BIT_PAUSE_LEN_MAX)\r
- { // it's RCMM\r
+ if (irmp_pulse_time >= RCMM32_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= RCMM32_START_BIT_PULSE_LEN_MAX &&\r
+ irmp_pause_time >= RCMM32_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= RCMM32_START_BIT_PAUSE_LEN_MAX)\r
+ { // it's RCMM\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("protocol = RCMM, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- RCMM32_START_BIT_PULSE_LEN_MIN, RCMM32_START_BIT_PULSE_LEN_MAX,\r
- RCMM32_START_BIT_PAUSE_LEN_MIN, RCMM32_START_BIT_PAUSE_LEN_MAX);\r
+ ANALYZE_PRINTF ("protocol = RCMM, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ RCMM32_START_BIT_PULSE_LEN_MIN, RCMM32_START_BIT_PULSE_LEN_MAX,\r
+ RCMM32_START_BIT_PAUSE_LEN_MIN, RCMM32_START_BIT_PAUSE_LEN_MAX);\r
#endif // ANALYZE\r
- irmp_param_p = (IRMP_PARAMETER *) &rcmm_param;\r
- }\r
- else\r
+ irmp_param_p = (IRMP_PARAMETER *) &rcmm_param;\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_RCMM_PROTOCOL == 1\r
- {\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("protocol = UNKNOWN\n");\r
+ ANALYZE_PRINTF ("protocol = UNKNOWN\n");\r
#endif // ANALYZE\r
- irmp_start_bit_detected = 0; // wait for another start bit...\r
- }\r
+ irmp_start_bit_detected = 0; // wait for another start bit...\r
+ }\r
\r
- if (irmp_start_bit_detected)\r
- {\r
- memcpy_P (&irmp_param, irmp_param_p, sizeof (IRMP_PARAMETER));\r
+ if (irmp_start_bit_detected)\r
+ {\r
+ memcpy_P (&irmp_param, irmp_param_p, sizeof (IRMP_PARAMETER));\r
\r
- if (! (irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER))\r
- {\r
+ if (! (irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER))\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("pulse_1: %3d - %3d\n", irmp_param.pulse_1_len_min, irmp_param.pulse_1_len_max);\r
- ANALYZE_PRINTF ("pause_1: %3d - %3d\n", irmp_param.pause_1_len_min, irmp_param.pause_1_len_max);\r
+ ANALYZE_PRINTF ("pulse_1: %3d - %3d\n", irmp_param.pulse_1_len_min, irmp_param.pulse_1_len_max);\r
+ ANALYZE_PRINTF ("pause_1: %3d - %3d\n", irmp_param.pause_1_len_min, irmp_param.pause_1_len_max);\r
#endif // ANALYZE\r
- }\r
- else\r
- {\r
+ }\r
+ else\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("pulse: %3d - %3d or %3d - %3d\n", irmp_param.pulse_1_len_min, 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
- 2 * irmp_param.pause_1_len_min, 2 * irmp_param.pause_1_len_max);\r
+ ANALYZE_PRINTF ("pulse: %3d - %3d or %3d - %3d\n", irmp_param.pulse_1_len_min, 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
+ 2 * irmp_param.pause_1_len_min, 2 * irmp_param.pause_1_len_max);\r
#endif // ANALYZE\r
- }\r
+ }\r
\r
#if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)\r
- if (irmp_param2.protocol)\r
- {\r
+ if (irmp_param2.protocol)\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("pulse_0: %3d - %3d\n", irmp_param2.pulse_0_len_min, irmp_param2.pulse_0_len_max);\r
- ANALYZE_PRINTF ("pause_0: %3d - %3d\n", irmp_param2.pause_0_len_min, irmp_param2.pause_0_len_max);\r
- ANALYZE_PRINTF ("pulse_1: %3d - %3d\n", irmp_param2.pulse_1_len_min, irmp_param2.pulse_1_len_max);\r
- ANALYZE_PRINTF ("pause_1: %3d - %3d\n", irmp_param2.pause_1_len_min, irmp_param2.pause_1_len_max);\r
+ ANALYZE_PRINTF ("pulse_0: %3d - %3d\n", irmp_param2.pulse_0_len_min, irmp_param2.pulse_0_len_max);\r
+ ANALYZE_PRINTF ("pause_0: %3d - %3d\n", irmp_param2.pause_0_len_min, irmp_param2.pause_0_len_max);\r
+ ANALYZE_PRINTF ("pulse_1: %3d - %3d\n", irmp_param2.pulse_1_len_min, irmp_param2.pulse_1_len_max);\r
+ ANALYZE_PRINTF ("pause_1: %3d - %3d\n", irmp_param2.pause_1_len_min, irmp_param2.pause_1_len_max);\r
#endif // ANALYZE\r
- }\r
+ }\r
#endif\r
\r
\r
#if IRMP_SUPPORT_RC6_PROTOCOL == 1\r
- if (irmp_param.protocol == IRMP_RC6_PROTOCOL)\r
- {\r
+ if (irmp_param.protocol == IRMP_RC6_PROTOCOL)\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("pulse_toggle: %3d - %3d\n", RC6_TOGGLE_BIT_LEN_MIN, RC6_TOGGLE_BIT_LEN_MAX);\r
+ ANALYZE_PRINTF ("pulse_toggle: %3d - %3d\n", RC6_TOGGLE_BIT_LEN_MIN, RC6_TOGGLE_BIT_LEN_MAX);\r
#endif // ANALYZE\r
- }\r
+ }\r
#endif\r
\r
- if (! (irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER))\r
- {\r
+ if (! (irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER))\r
+ {\r
#ifdef ANALYZE\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
+ 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
#endif // ANALYZE\r
- }\r
- else\r
- {\r
+ }\r
+ else\r
+ {\r
#ifdef ANALYZE\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
+ 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
#endif // ANALYZE\r
- }\r
+ }\r
\r
#ifdef ANALYZE\r
#if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1\r
- if (irmp_param.protocol == IRMP_BANG_OLUFSEN_PROTOCOL)\r
- {\r
- ANALYZE_PRINTF ("pulse_r: %3d - %3d\n", irmp_param.pulse_0_len_min, irmp_param.pulse_0_len_max);\r
- ANALYZE_PRINTF ("pause_r: %3d - %3d\n", BANG_OLUFSEN_R_PAUSE_LEN_MIN, BANG_OLUFSEN_R_PAUSE_LEN_MAX);\r
- }\r
+ if (irmp_param.protocol == IRMP_BANG_OLUFSEN_PROTOCOL)\r
+ {\r
+ ANALYZE_PRINTF ("pulse_r: %3d - %3d\n", irmp_param.pulse_0_len_min, irmp_param.pulse_0_len_max);\r
+ ANALYZE_PRINTF ("pause_r: %3d - %3d\n", BANG_OLUFSEN_R_PAUSE_LEN_MIN, BANG_OLUFSEN_R_PAUSE_LEN_MAX);\r
+ }\r
#endif\r
\r
- ANALYZE_PRINTF ("command_offset: %2d\n", irmp_param.command_offset);\r
- ANALYZE_PRINTF ("command_len: %3d\n", irmp_param.command_end - irmp_param.command_offset);\r
- ANALYZE_PRINTF ("complete_len: %3d\n", irmp_param.complete_len);\r
- ANALYZE_PRINTF ("stop_bit: %3d\n", irmp_param.stop_bit);\r
+ ANALYZE_PRINTF ("command_offset: %2d\n", irmp_param.command_offset);\r
+ ANALYZE_PRINTF ("command_len: %3d\n", irmp_param.command_end - irmp_param.command_offset);\r
+ ANALYZE_PRINTF ("complete_len: %3d\n", irmp_param.complete_len);\r
+ ANALYZE_PRINTF ("stop_bit: %3d\n", irmp_param.stop_bit);\r
#endif // ANALYZE\r
- }\r
+ }\r
\r
- irmp_bit = 0;\r
+ irmp_bit = 0;\r
\r
#if IRMP_SUPPORT_MANCHESTER == 1\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
-#ifdef ANALYZE\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
-#endif // ANALYZE\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
-#ifdef ANALYZE\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) ? '1' : '0');\r
- ANALYZE_NEWLINE ();\r
-#endif // ANALYZE\r
- irmp_store_bit ((irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? 1 : 0);\r
- }\r
- }\r
- else\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
+#ifdef ANALYZE\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
+#endif // ANALYZE\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
+#ifdef ANALYZE\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) ? '1' : '0');\r
+ ANALYZE_NEWLINE ();\r
+#endif // ANALYZE\r
+ irmp_store_bit ((irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? 1 : 0);\r
+ }\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
- ; // do nothing\r
- }\r
- else\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
+ if (irmp_param.protocol == IRMP_DENON_PROTOCOL)\r
+ {\r
#ifdef ANALYZE\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_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_bit, irmp_pulse_time, irmp_pause_time);\r
#endif // ANALYZE\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
+ if (irmp_pause_time >= DENON_1_PAUSE_LEN_MIN && irmp_pause_time <= DENON_1_PAUSE_LEN_MAX)\r
+ { // pause timings correct for "1"?\r
#ifdef ANALYZE\r
- ANALYZE_PUTCHAR ('1'); // yes, store 1\r
- ANALYZE_NEWLINE ();\r
+ ANALYZE_PUTCHAR ('1'); // yes, store 1\r
+ ANALYZE_NEWLINE ();\r
#endif // ANALYZE\r
- irmp_store_bit (1);\r
- }\r
- else // if (irmp_pause_time >= DENON_0_PAUSE_LEN_MIN && irmp_pause_time <= DENON_0_PAUSE_LEN_MAX)\r
- { // pause timings correct for "0"?\r
+ irmp_store_bit (1);\r
+ }\r
+ else // if (irmp_pause_time >= DENON_0_PAUSE_LEN_MIN && irmp_pause_time <= DENON_0_PAUSE_LEN_MAX)\r
+ { // pause timings correct for "0"?\r
#ifdef ANALYZE\r
- ANALYZE_PUTCHAR ('0'); // yes, store 0\r
- ANALYZE_NEWLINE ();\r
+ ANALYZE_PUTCHAR ('0'); // yes, store 0\r
+ ANALYZE_NEWLINE ();\r
#endif // ANALYZE\r
- irmp_store_bit (0);\r
- }\r
- }\r
- else\r
+ irmp_store_bit (0);\r
+ }\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
+ if (irmp_param.protocol == IRMP_THOMSON_PROTOCOL)\r
+ {\r
#ifdef ANALYZE\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_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_bit, irmp_pulse_time, irmp_pause_time);\r
#endif // ANALYZE\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
+ if (irmp_pause_time >= THOMSON_1_PAUSE_LEN_MIN && irmp_pause_time <= THOMSON_1_PAUSE_LEN_MAX)\r
+ { // pause timings correct for "1"?\r
#ifdef ANALYZE\r
- ANALYZE_PUTCHAR ('1'); // yes, store 1\r
- ANALYZE_NEWLINE ();\r
+ ANALYZE_PUTCHAR ('1'); // yes, store 1\r
+ ANALYZE_NEWLINE ();\r
#endif // ANALYZE\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
+ 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
#ifdef ANALYZE\r
- ANALYZE_PUTCHAR ('0'); // yes, store 0\r
- ANALYZE_NEWLINE ();\r
+ ANALYZE_PUTCHAR ('0'); // yes, store 0\r
+ ANALYZE_NEWLINE ();\r
#endif // ANALYZE\r
- irmp_store_bit (0);\r
- }\r
- }\r
- else\r
+ irmp_store_bit (0);\r
+ }\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_THOMSON_PROTOCOL == 1\r
- {\r
- ; // else do nothing\r
- }\r
-\r
- irmp_pulse_time = 1; // set counter to 1, not 0\r
- irmp_pause_time = 0;\r
- wait_for_start_space = 0;\r
- }\r
- }\r
- else if (wait_for_space) // the data section....\r
- { // counting the time of darkness....\r
- uint_fast8_t got_light = FALSE;\r
-\r
- if (irmp_input) // still dark?\r
- { // yes...\r
- if (irmp_bit == irmp_param.complete_len && irmp_param.stop_bit == 1)\r
- {\r
- if (\r
+ {\r
+ ; // else do nothing\r
+ }\r
+\r
+ irmp_pulse_time = 1; // set counter to 1, not 0\r
+ irmp_pause_time = 0;\r
+ wait_for_start_space = 0;\r
+ }\r
+ }\r
+ else if (wait_for_space) // the data section....\r
+ { // counting the time of darkness....\r
+ uint_fast8_t got_light = FALSE;\r
+\r
+ if (irmp_input) // still dark?\r
+ { // yes...\r
+ if (irmp_bit == irmp_param.complete_len && irmp_param.stop_bit == 1)\r
+ {\r
+ if (\r
#if IRMP_SUPPORT_MANCHESTER == 1\r
- (irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER) ||\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
+ (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
- ANALYZE_PRINTF ("stop bit detected\n");\r
- }\r
-#endif // ANALYZE\r
- irmp_param.stop_bit = 0;\r
- }\r
- else\r
- {\r
-#ifdef ANALYZE\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
-#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
- else\r
- {\r
- irmp_pause_time++; // increment counter\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
+ ANALYZE_PRINTF ("stop bit detected\n");\r
+ }\r
+#endif // ANALYZE\r
+ irmp_param.stop_bit = 0;\r
+ }\r
+ else\r
+ {\r
+#ifdef ANALYZE\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
+#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
+ else\r
+ {\r
+ irmp_pause_time++; // increment counter\r
\r
#if IRMP_SUPPORT_SIRCS_PROTOCOL == 1\r
- if (irmp_param.protocol == IRMP_SIRCS_PROTOCOL && // Sony has a variable number of bits:\r
- irmp_pause_time > SIRCS_PAUSE_LEN_MAX && // minimum is 12\r
- irmp_bit >= 12 - 1) // pause too long?\r
- { // yes, break and close this frame\r
- irmp_param.complete_len = irmp_bit + 1; // set new complete length\r
- got_light = TRUE; // this is a lie, but helps (generates stop bit)\r
- irmp_tmp_address |= (irmp_bit - SIRCS_MINIMUM_DATA_LEN + 1) << 8; // new: store number of additional bits in upper byte of address!\r
- irmp_param.command_end = irmp_param.command_offset + irmp_bit + 1; // correct command length\r
- irmp_pause_time = SIRCS_PAUSE_LEN_MAX - 1; // correct pause length\r
- }\r
- else\r
+ if (irmp_param.protocol == IRMP_SIRCS_PROTOCOL && // Sony has a variable number of bits:\r
+ irmp_pause_time > SIRCS_PAUSE_LEN_MAX && // minimum is 12\r
+ irmp_bit >= 12 - 1) // pause too long?\r
+ { // yes, break and close this frame\r
+ irmp_param.complete_len = irmp_bit + 1; // set new complete length\r
+ got_light = TRUE; // this is a lie, but helps (generates stop bit)\r
+ irmp_tmp_address |= (irmp_bit - SIRCS_MINIMUM_DATA_LEN + 1) << 8; // new: store number of additional bits in upper byte of address!\r
+ irmp_param.command_end = irmp_param.command_offset + irmp_bit + 1; // correct command length\r
+ irmp_pause_time = SIRCS_PAUSE_LEN_MAX - 1; // correct pause length\r
+ }\r
+ else\r
#endif\r
#if IRMP_SUPPORT_FAN_PROTOCOL == 1\r
- if (irmp_param.protocol == IRMP_FAN_PROTOCOL && // FAN has no stop bit.\r
- irmp_bit >= FAN_COMPLETE_DATA_LEN - 1) // last bit in frame\r
- { // yes, break and close this frame\r
- if (irmp_pulse_time <= FAN_0_PULSE_LEN_MAX && irmp_pause_time >= FAN_0_PAUSE_LEN_MIN)\r
- {\r
+ if (irmp_param.protocol == IRMP_FAN_PROTOCOL && // FAN has no stop bit.\r
+ irmp_bit >= FAN_COMPLETE_DATA_LEN - 1) // last bit in frame\r
+ { // yes, break and close this frame\r
+ if (irmp_pulse_time <= FAN_0_PULSE_LEN_MAX && irmp_pause_time >= FAN_0_PAUSE_LEN_MIN)\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("Generating virtual stop bit\n");\r
+ ANALYZE_PRINTF ("Generating virtual stop bit\n");\r
#endif // ANALYZE\r
- got_light = TRUE; // this is a lie, but helps (generates stop bit)\r
- }\r
- else if (irmp_pulse_time >= FAN_1_PULSE_LEN_MIN && irmp_pause_time >= FAN_1_PAUSE_LEN_MIN)\r
- {\r
+ got_light = TRUE; // this is a lie, but helps (generates stop bit)\r
+ }\r
+ else if (irmp_pulse_time >= FAN_1_PULSE_LEN_MIN && irmp_pause_time >= FAN_1_PAUSE_LEN_MIN)\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("Generating virtual stop bit\n");\r
+ ANALYZE_PRINTF ("Generating virtual stop bit\n");\r
#endif // ANALYZE\r
- got_light = TRUE; // this is a lie, but helps (generates stop bit)\r
- }\r
- }\r
- else\r
+ got_light = TRUE; // this is a lie, but helps (generates stop bit)\r
+ }\r
+ }\r
+ else\r
#endif\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
+ // 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 > IR60_TIMEOUT_LEN && (irmp_bit == 5 || irmp_bit == 6))\r
- {\r
-#ifdef ANALYZE\r
- ANALYZE_PRINTF ("Switching to IR60 protocol\n");\r
-#endif // ANALYZE\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
- irmp_param.stop_bit = TRUE; // set flag\r
- }\r
- else if (irmp_bit >= GRUNDIG_COMPLETE_DATA_LEN)\r
- {\r
-#ifdef ANALYZE\r
- ANALYZE_PRINTF ("Switching to NOKIA protocol, irmp_bit = %d\n", irmp_bit);\r
-#endif // ANALYZE\r
- irmp_param.protocol = IRMP_NOKIA_PROTOCOL; // change protocol\r
- irmp_param.address_offset = NOKIA_ADDRESS_OFFSET;\r
- irmp_param.address_end = NOKIA_ADDRESS_OFFSET + NOKIA_ADDRESS_LEN;\r
- irmp_param.command_offset = NOKIA_COMMAND_OFFSET;\r
- irmp_param.command_end = NOKIA_COMMAND_OFFSET + NOKIA_COMMAND_LEN;\r
-\r
- if (irmp_tmp_command & 0x300)\r
- {\r
- irmp_tmp_address = (irmp_tmp_command >> 8);\r
- irmp_tmp_command &= 0xFF;\r
- }\r
- }\r
- }\r
- else\r
+ if (irmp_param.protocol == IRMP_GRUNDIG_PROTOCOL && !irmp_param.stop_bit)\r
+ {\r
+ if (irmp_pause_time > IR60_TIMEOUT_LEN && (irmp_bit == 5 || irmp_bit == 6))\r
+ {\r
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("Switching to IR60 protocol\n");\r
+#endif // ANALYZE\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
+ irmp_param.stop_bit = TRUE; // set flag\r
+ }\r
+ else if (irmp_bit >= GRUNDIG_COMPLETE_DATA_LEN)\r
+ {\r
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("Switching to NOKIA protocol, irmp_bit = %d\n", irmp_bit);\r
+#endif // ANALYZE\r
+ irmp_param.protocol = IRMP_NOKIA_PROTOCOL; // change protocol\r
+ irmp_param.address_offset = NOKIA_ADDRESS_OFFSET;\r
+ irmp_param.address_end = NOKIA_ADDRESS_OFFSET + NOKIA_ADDRESS_LEN;\r
+ irmp_param.command_offset = NOKIA_COMMAND_OFFSET;\r
+ irmp_param.command_end = NOKIA_COMMAND_OFFSET + NOKIA_COMMAND_LEN;\r
+\r
+ if (irmp_tmp_command & 0x300)\r
+ {\r
+ irmp_tmp_address = (irmp_tmp_command >> 8);\r
+ irmp_tmp_command &= 0xFF;\r
+ }\r
+ }\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
-#ifdef ANALYZE\r
- ANALYZE_PRINTF ("Switching to SIEMENS protocol\n");\r
-#endif // ANALYZE\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
+ 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
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("Switching to SIEMENS protocol\n");\r
+#endif // ANALYZE\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
+ irmp_tmp_command |= last_value;\r
+ }\r
+ }\r
+ else\r
#endif\r
#if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1\r
- if (irmp_param.protocol == IRMP_ROOMBA_PROTOCOL && // Roomba has no stop bit\r
- irmp_bit >= ROOMBA_COMPLETE_DATA_LEN - 1) // it's the last data bit...\r
- { // break and close this frame\r
- if (irmp_pulse_time >= ROOMBA_1_PULSE_LEN_MIN && irmp_pulse_time <= ROOMBA_1_PULSE_LEN_MAX)\r
- {\r
- irmp_pause_time = ROOMBA_1_PAUSE_LEN_EXACT;\r
- }\r
- else if (irmp_pulse_time >= ROOMBA_0_PULSE_LEN_MIN && irmp_pulse_time <= ROOMBA_0_PULSE_LEN_MAX)\r
- {\r
- irmp_pause_time = ROOMBA_0_PAUSE_LEN;\r
- }\r
-\r
- got_light = TRUE; // this is a lie, but helps (generates stop bit)\r
- }\r
- else\r
+ if (irmp_param.protocol == IRMP_ROOMBA_PROTOCOL && // Roomba has no stop bit\r
+ irmp_bit >= ROOMBA_COMPLETE_DATA_LEN - 1) // it's the last data bit...\r
+ { // break and close this frame\r
+ if (irmp_pulse_time >= ROOMBA_1_PULSE_LEN_MIN && irmp_pulse_time <= ROOMBA_1_PULSE_LEN_MAX)\r
+ {\r
+ irmp_pause_time = ROOMBA_1_PAUSE_LEN_EXACT;\r
+ }\r
+ else if (irmp_pulse_time >= ROOMBA_0_PULSE_LEN_MIN && irmp_pulse_time <= ROOMBA_0_PULSE_LEN_MAX)\r
+ {\r
+ irmp_pause_time = ROOMBA_0_PAUSE_LEN;\r
+ }\r
+\r
+ got_light = TRUE; // this is a lie, but helps (generates stop bit)\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
- { // 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
- }\r
- else\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
+ { // 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
+ }\r
+ else\r
#endif // IRMP_SUPPORT_MANCHESTER == 1\r
- if (irmp_pause_time > IRMP_TIMEOUT_LEN) // timeout?\r
- { // yes...\r
- if (irmp_bit == irmp_param.complete_len - 1 && irmp_param.stop_bit == 0)\r
- {\r
- irmp_bit++;\r
- }\r
+ if (irmp_pause_time > IRMP_TIMEOUT_LEN) // timeout?\r
+ { // yes...\r
+ if (irmp_bit == irmp_param.complete_len - 1 && irmp_param.stop_bit == 0)\r
+ {\r
+ irmp_bit++;\r
+ }\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
-#ifdef ANALYZE\r
- ANALYZE_PRINTF ("Switching to JVC protocol, irmp_bit = %d\n", irmp_bit);\r
-#endif // ANALYZE\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_tmp_command = (irmp_tmp_address >> 4); // set command: upper 12 bits are command bits\r
- irmp_tmp_address = irmp_tmp_address & 0x000F; // lower 4 bits are address bits\r
- irmp_start_bit_detected = 1; // tricky: don't wait for another start bit...\r
- }\r
+ else if (irmp_param.protocol == IRMP_NEC_PROTOCOL && (irmp_bit == 16 || irmp_bit == 17)) // it was a JVC stop bit\r
+ {\r
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("Switching to JVC protocol, irmp_bit = %d\n", irmp_bit);\r
+#endif // ANALYZE\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_tmp_command = (irmp_tmp_address >> 4); // set command: upper 12 bits are command bits\r
+ irmp_tmp_address = irmp_tmp_address & 0x000F; // lower 4 bits are address bits\r
+ irmp_start_bit_detected = 1; // tricky: don't wait for another start bit...\r
+ }\r
#endif // IRMP_SUPPORT_JVC_PROTOCOL == 1\r
#if IRMP_SUPPORT_LGAIR_PROTOCOL == 1\r
- else if (irmp_param.protocol == IRMP_NEC_PROTOCOL && (irmp_bit == 28 || irmp_bit == 29)) // it was a LGAIR stop bit\r
- {\r
-#ifdef ANALYZE\r
- ANALYZE_PRINTF ("Switching to LGAIR protocol, irmp_bit = %d\n", irmp_bit);\r
-#endif // ANALYZE\r
- irmp_param.stop_bit = TRUE; // set flag\r
- irmp_param.protocol = IRMP_LGAIR_PROTOCOL; // switch protocol\r
- irmp_param.complete_len = irmp_bit; // patch length: 16 or 17\r
- irmp_tmp_command = irmp_lgair_command; // set command: upper 8 bits are command bits\r
- irmp_tmp_address = irmp_lgair_address; // lower 4 bits are address bits\r
- irmp_start_bit_detected = 1; // tricky: don't wait for another start bit...\r
- }\r
+ else if (irmp_param.protocol == IRMP_NEC_PROTOCOL && (irmp_bit == 28 || irmp_bit == 29)) // it was a LGAIR stop bit\r
+ {\r
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("Switching to LGAIR protocol, irmp_bit = %d\n", irmp_bit);\r
+#endif // ANALYZE\r
+ irmp_param.stop_bit = TRUE; // set flag\r
+ irmp_param.protocol = IRMP_LGAIR_PROTOCOL; // switch protocol\r
+ irmp_param.complete_len = irmp_bit; // patch length: 16 or 17\r
+ irmp_tmp_command = irmp_lgair_command; // set command: upper 8 bits are command bits\r
+ irmp_tmp_address = irmp_lgair_address; // lower 4 bits are address bits\r
+ irmp_start_bit_detected = 1; // tricky: don't wait for another start bit...\r
+ }\r
#endif // IRMP_SUPPORT_LGAIR_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
+ else if (irmp_param.protocol == IRMP_NEC42_PROTOCOL && irmp_bit == 32) // it was a NEC stop bit\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("Switching to NEC protocol\n");\r
+ ANALYZE_PRINTF ("Switching to NEC protocol\n");\r
#endif // ANALYZE\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
+ 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
+ // 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_LGAIR_PROTOCOL == 1\r
- else if (irmp_param.protocol == IRMP_NEC42_PROTOCOL && irmp_bit == 28) // it was a NEC stop bit\r
- {\r
+ else if (irmp_param.protocol == IRMP_NEC42_PROTOCOL && irmp_bit == 28) // it was a NEC stop bit\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("Switching to LGAIR protocol\n");\r
+ ANALYZE_PRINTF ("Switching to LGAIR protocol\n");\r
#endif // ANALYZE\r
- irmp_param.stop_bit = TRUE; // set flag\r
- irmp_param.protocol = IRMP_LGAIR_PROTOCOL; // switch protocol\r
- irmp_param.complete_len = irmp_bit; // patch length: 16 or 17\r
- irmp_tmp_address = irmp_lgair_address;\r
- irmp_tmp_command = irmp_lgair_command;\r
- }\r
+ irmp_param.stop_bit = TRUE; // set flag\r
+ irmp_param.protocol = IRMP_LGAIR_PROTOCOL; // switch protocol\r
+ irmp_param.complete_len = irmp_bit; // patch length: 16 or 17\r
+ irmp_tmp_address = irmp_lgair_address;\r
+ irmp_tmp_command = irmp_lgair_command;\r
+ }\r
#endif // IRMP_SUPPORT_LGAIR_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
+ else if (irmp_param.protocol == IRMP_NEC42_PROTOCOL && (irmp_bit == 16 || irmp_bit == 17)) // it was a JVC stop bit\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("Switching to JVC protocol, irmp_bit = %d\n", irmp_bit);\r
+ ANALYZE_PRINTF ("Switching to JVC protocol, irmp_bit = %d\n", irmp_bit);\r
#endif // ANALYZE\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_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
+ // 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
\r
#if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1\r
- else if (irmp_param.protocol == IRMP_SAMSUNG48_PROTOCOL && irmp_bit == 32) // it was a SAMSUNG32 stop bit\r
- {\r
+ else if (irmp_param.protocol == IRMP_SAMSUNG48_PROTOCOL && irmp_bit == 32) // it was a SAMSUNG32 stop bit\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("Switching to SAMSUNG32 protocol\n");\r
+ ANALYZE_PRINTF ("Switching to SAMSUNG32 protocol\n");\r
#endif // ANALYZE\r
- irmp_param.protocol = IRMP_SAMSUNG32_PROTOCOL;\r
- irmp_param.command_offset = SAMSUNG32_COMMAND_OFFSET;\r
- irmp_param.command_end = SAMSUNG32_COMMAND_OFFSET + SAMSUNG32_COMMAND_LEN;\r
- irmp_param.complete_len = SAMSUNG32_COMPLETE_DATA_LEN;\r
- }\r
+ irmp_param.protocol = IRMP_SAMSUNG32_PROTOCOL;\r
+ irmp_param.command_offset = SAMSUNG32_COMMAND_OFFSET;\r
+ irmp_param.command_end = SAMSUNG32_COMMAND_OFFSET + SAMSUNG32_COMMAND_LEN;\r
+ irmp_param.complete_len = SAMSUNG32_COMPLETE_DATA_LEN;\r
+ }\r
#endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1\r
\r
#if IRMP_SUPPORT_RCMM_PROTOCOL == 1\r
- else if (irmp_param.protocol == IRMP_RCMM32_PROTOCOL && (irmp_bit == 12 || irmp_bit == 24)) // it was a RCMM stop bit\r
- {\r
- if (irmp_bit == 12)\r
- {\r
- irmp_tmp_command = (irmp_tmp_address & 0xFF); // set command: lower 8 bits are command bits\r
- irmp_tmp_address >>= 8; // upper 4 bits are address bits\r
+ else if (irmp_param.protocol == IRMP_RCMM32_PROTOCOL && (irmp_bit == 12 || irmp_bit == 24)) // it was a RCMM stop bit\r
+ {\r
+ if (irmp_bit == 12)\r
+ {\r
+ irmp_tmp_command = (irmp_tmp_address & 0xFF); // set command: lower 8 bits are command bits\r
+ irmp_tmp_address >>= 8; // upper 4 bits are address bits\r
\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("Switching to RCMM12 protocol, irmp_bit = %d\n", irmp_bit);\r
+ ANALYZE_PRINTF ("Switching to RCMM12 protocol, irmp_bit = %d\n", irmp_bit);\r
#endif // ANALYZE\r
- irmp_param.protocol = IRMP_RCMM12_PROTOCOL; // switch protocol\r
- }\r
- else // if ((irmp_bit == 24)\r
- {\r
+ irmp_param.protocol = IRMP_RCMM12_PROTOCOL; // switch protocol\r
+ }\r
+ else // if ((irmp_bit == 24)\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("Switching to RCMM24 protocol, irmp_bit = %d\n", irmp_bit);\r
+ ANALYZE_PRINTF ("Switching to RCMM24 protocol, irmp_bit = %d\n", irmp_bit);\r
#endif // ANALYZE\r
- irmp_param.protocol = IRMP_RCMM24_PROTOCOL; // switch protocol\r
- }\r
- irmp_param.stop_bit = TRUE; // set flag\r
- irmp_param.complete_len = irmp_bit; // patch length\r
- }\r
+ irmp_param.protocol = IRMP_RCMM24_PROTOCOL; // switch protocol\r
+ }\r
+ irmp_param.stop_bit = TRUE; // set flag\r
+ 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
+ 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
+ else\r
+ {\r
#ifdef ANALYZE\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
+ 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
#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
- }\r
- }\r
- else\r
- { // got light now!\r
- got_light = TRUE;\r
- }\r
+ irmp_start_bit_detected = 0; // wait for another start bit...\r
+ irmp_pulse_time = 0;\r
+ irmp_pause_time = 0;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ else\r
+ { // got light now!\r
+ got_light = TRUE;\r
+ }\r
\r
- if (got_light)\r
- {\r
+ if (got_light)\r
+ {\r
#ifdef ANALYZE\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_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_bit, irmp_pulse_time, irmp_pause_time);\r
#endif // ANALYZE\r
\r
#if IRMP_SUPPORT_MANCHESTER == 1\r
- if ((irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER)) // Manchester\r
- {\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
+ 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
+ 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
+ {\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
-#ifdef ANALYZE\r
- ANALYZE_PUTCHAR ('T');\r
-#endif // ANALYZE\r
- if (irmp_param.complete_len == RC6_COMPLETE_DATA_LEN_LONG) // RC6 mode 6A\r
- {\r
- irmp_store_bit (1);\r
- last_value = 1;\r
- }\r
- else // RC6 mode 0\r
- {\r
- irmp_store_bit (0);\r
- last_value = 0;\r
- }\r
-#ifdef ANALYZE\r
- ANALYZE_NEWLINE ();\r
-#endif // ANALYZE\r
- }\r
- else\r
+ if (irmp_param.protocol == IRMP_RC6_PROTOCOL && irmp_bit == 4 && irmp_pulse_time > RC6_TOGGLE_BIT_LEN_MIN) // RC6 toggle bit\r
+ {\r
+#ifdef ANALYZE\r
+ ANALYZE_PUTCHAR ('T');\r
+#endif // ANALYZE\r
+ if (irmp_param.complete_len == RC6_COMPLETE_DATA_LEN_LONG) // RC6 mode 6A\r
+ {\r
+ irmp_store_bit (1);\r
+ last_value = 1;\r
+ }\r
+ else // RC6 mode 0\r
+ {\r
+ irmp_store_bit (0);\r
+ last_value = 0;\r
+ }\r
+#ifdef ANALYZE\r
+ ANALYZE_NEWLINE ();\r
+#endif // ANALYZE\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_RC6_PROTOCOL == 1\r
- {\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PUTCHAR ((irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? '0' : '1');\r
+ ANALYZE_PUTCHAR ((irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? '0' : '1');\r
#endif // ANALYZE\r
- irmp_store_bit ((irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? 0 : 1 );\r
+ irmp_store_bit ((irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? 0 : 1 );\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
+ if (irmp_param.protocol == IRMP_RC6_PROTOCOL && irmp_bit == 4 && irmp_pulse_time > RC6_TOGGLE_BIT_LEN_MIN) // RC6 toggle bit\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PUTCHAR ('T');\r
+ ANALYZE_PUTCHAR ('T');\r
#endif // ANALYZE\r
- irmp_store_bit (1);\r
+ irmp_store_bit (1);\r
\r
- if (irmp_pause_time > 2 * irmp_param.pause_1_len_max)\r
- {\r
- last_value = 0;\r
- }\r
- else\r
- {\r
- last_value = 1;\r
- }\r
+ if (irmp_pause_time > 2 * irmp_param.pause_1_len_max)\r
+ {\r
+ last_value = 0;\r
+ }\r
+ else\r
+ {\r
+ last_value = 1;\r
+ }\r
#ifdef ANALYZE\r
- ANALYZE_NEWLINE ();\r
+ ANALYZE_NEWLINE ();\r
#endif // ANALYZE\r
- }\r
- else\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_RC6_PROTOCOL == 1\r
- {\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PUTCHAR ((irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? '1' : '0');\r
+ ANALYZE_PUTCHAR ((irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? '1' : '0');\r
#endif // ANALYZE\r
- irmp_store_bit ((irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? 1 : 0 );\r
+ irmp_store_bit ((irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? 1 : 0 );\r
#if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)\r
- if (! irmp_param2.protocol)\r
+ if (! irmp_param2.protocol)\r
#endif\r
- {\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_NEWLINE ();\r
+ ANALYZE_NEWLINE ();\r
#endif // ANALYZE\r
- }\r
- last_value = (irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? 1 : 0;\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
- /* && irmp_pause_time <= 2 * irmp_param.pause_1_len_max */)\r
- {\r
- uint_fast8_t manchester_value;\r
+ }\r
+ last_value = (irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? 1 : 0;\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
+ /* && irmp_pause_time <= 2 * irmp_param.pause_1_len_max */)\r
+ {\r
+ uint_fast8_t manchester_value;\r
\r
- if (last_pause > irmp_param.pause_1_len_max && last_pause <= 2 * irmp_param.pause_1_len_max)\r
- {\r
- manchester_value = last_value ? 0 : 1;\r
- last_value = manchester_value;\r
- }\r
- else\r
- {\r
- manchester_value = last_value;\r
- }\r
+ if (last_pause > irmp_param.pause_1_len_max && last_pause <= 2 * irmp_param.pause_1_len_max)\r
+ {\r
+ manchester_value = last_value ? 0 : 1;\r
+ last_value = manchester_value;\r
+ }\r
+ else\r
+ {\r
+ manchester_value = last_value;\r
+ }\r
\r
#ifdef ANALYZE\r
- ANALYZE_PUTCHAR (manchester_value + '0');\r
+ ANALYZE_PUTCHAR (manchester_value + '0');\r
#endif // ANALYZE\r
\r
#if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)\r
- if (! irmp_param2.protocol)\r
+ if (! irmp_param2.protocol)\r
#endif\r
- {\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_NEWLINE ();\r
+ ANALYZE_NEWLINE ();\r
#endif // ANALYZE\r
- }\r
+ }\r
\r
#if IRMP_SUPPORT_RC6_PROTOCOL == 1\r
- if (irmp_param.protocol == IRMP_RC6_PROTOCOL && irmp_bit == 1 && manchester_value == 1) // RC6 mode != 0 ???\r
- {\r
-#ifdef ANALYZE\r
- ANALYZE_PRINTF ("Switching to RC6A protocol\n");\r
-#endif // ANALYZE\r
- irmp_param.complete_len = RC6_COMPLETE_DATA_LEN_LONG;\r
- irmp_param.address_offset = 5;\r
- irmp_param.address_end = irmp_param.address_offset + 15;\r
- irmp_param.command_offset = irmp_param.address_end + 1; // skip 1 system bit, changes like a toggle bit\r
- irmp_param.command_end = irmp_param.command_offset + 16 - 1;\r
- irmp_tmp_address = 0;\r
- }\r
+ if (irmp_param.protocol == IRMP_RC6_PROTOCOL && irmp_bit == 1 && manchester_value == 1) // RC6 mode != 0 ???\r
+ {\r
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("Switching to RC6A protocol\n");\r
+#endif // ANALYZE\r
+ irmp_param.complete_len = RC6_COMPLETE_DATA_LEN_LONG;\r
+ irmp_param.address_offset = 5;\r
+ irmp_param.address_end = irmp_param.address_offset + 15;\r
+ irmp_param.command_offset = irmp_param.address_end + 1; // skip 1 system bit, changes like a toggle bit\r
+ irmp_param.command_end = irmp_param.command_offset + 16 - 1;\r
+ irmp_tmp_address = 0;\r
+ }\r
#endif // IRMP_SUPPORT_RC6_PROTOCOL == 1\r
\r
- irmp_store_bit (manchester_value);\r
- }\r
- else\r
- {\r
+ irmp_store_bit (manchester_value);\r
+ }\r
+ else\r
+ {\r
#if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_FDC_PROTOCOL == 1\r
- if (irmp_param2.protocol == IRMP_FDC_PROTOCOL &&\r
- irmp_pulse_time >= FDC_PULSE_LEN_MIN && irmp_pulse_time <= FDC_PULSE_LEN_MAX &&\r
- ((irmp_pause_time >= FDC_1_PAUSE_LEN_MIN && irmp_pause_time <= FDC_1_PAUSE_LEN_MAX) ||\r
- (irmp_pause_time >= FDC_0_PAUSE_LEN_MIN && irmp_pause_time <= FDC_0_PAUSE_LEN_MAX)))\r
- {\r
+ if (irmp_param2.protocol == IRMP_FDC_PROTOCOL &&\r
+ irmp_pulse_time >= FDC_PULSE_LEN_MIN && irmp_pulse_time <= FDC_PULSE_LEN_MAX &&\r
+ ((irmp_pause_time >= FDC_1_PAUSE_LEN_MIN && irmp_pause_time <= FDC_1_PAUSE_LEN_MAX) ||\r
+ (irmp_pause_time >= FDC_0_PAUSE_LEN_MIN && irmp_pause_time <= FDC_0_PAUSE_LEN_MAX)))\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PUTCHAR ('?');\r
+ ANALYZE_PUTCHAR ('?');\r
#endif // ANALYZE\r
- irmp_param.protocol = 0; // switch to FDC, see below\r
- }\r
- else\r
+ irmp_param.protocol = 0; // switch to FDC, see below\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_FDC_PROTOCOL == 1\r
#if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_RCCAR_PROTOCOL == 1\r
- if (irmp_param2.protocol == IRMP_RCCAR_PROTOCOL &&\r
- irmp_pulse_time >= RCCAR_PULSE_LEN_MIN && irmp_pulse_time <= RCCAR_PULSE_LEN_MAX &&\r
- ((irmp_pause_time >= RCCAR_1_PAUSE_LEN_MIN && irmp_pause_time <= RCCAR_1_PAUSE_LEN_MAX) ||\r
- (irmp_pause_time >= RCCAR_0_PAUSE_LEN_MIN && irmp_pause_time <= RCCAR_0_PAUSE_LEN_MAX)))\r
- {\r
+ if (irmp_param2.protocol == IRMP_RCCAR_PROTOCOL &&\r
+ irmp_pulse_time >= RCCAR_PULSE_LEN_MIN && irmp_pulse_time <= RCCAR_PULSE_LEN_MAX &&\r
+ ((irmp_pause_time >= RCCAR_1_PAUSE_LEN_MIN && irmp_pause_time <= RCCAR_1_PAUSE_LEN_MAX) ||\r
+ (irmp_pause_time >= RCCAR_0_PAUSE_LEN_MIN && irmp_pause_time <= RCCAR_0_PAUSE_LEN_MAX)))\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PUTCHAR ('?');\r
+ ANALYZE_PUTCHAR ('?');\r
#endif // ANALYZE\r
- irmp_param.protocol = 0; // switch to RCCAR, see below\r
- }\r
- else\r
+ irmp_param.protocol = 0; // switch to RCCAR, see below\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1\r
- {\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PUTCHAR ('?');\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
+ ANALYZE_PUTCHAR ('?');\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
#endif // ANALYZE\r
- irmp_start_bit_detected = 0; // reset flags and wait for next start bit\r
- irmp_pause_time = 0;\r
- }\r
- }\r
+ irmp_start_bit_detected = 0; // reset flags and wait for next start bit\r
+ irmp_pause_time = 0;\r
+ }\r
+ }\r
\r
#if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_FDC_PROTOCOL == 1\r
- if (irmp_param2.protocol == IRMP_FDC_PROTOCOL && irmp_pulse_time >= FDC_PULSE_LEN_MIN && irmp_pulse_time <= FDC_PULSE_LEN_MAX)\r
- {\r
- if (irmp_pause_time >= FDC_1_PAUSE_LEN_MIN && irmp_pause_time <= FDC_1_PAUSE_LEN_MAX)\r
- {\r
+ if (irmp_param2.protocol == IRMP_FDC_PROTOCOL && irmp_pulse_time >= FDC_PULSE_LEN_MIN && irmp_pulse_time <= FDC_PULSE_LEN_MAX)\r
+ {\r
+ if (irmp_pause_time >= FDC_1_PAUSE_LEN_MIN && irmp_pause_time <= FDC_1_PAUSE_LEN_MAX)\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF (" 1 (FDC)\n");\r
+ ANALYZE_PRINTF (" 1 (FDC)\n");\r
#endif // ANALYZE\r
- irmp_store_bit2 (1);\r
- }\r
- else if (irmp_pause_time >= FDC_0_PAUSE_LEN_MIN && irmp_pause_time <= FDC_0_PAUSE_LEN_MAX)\r
- {\r
+ irmp_store_bit2 (1);\r
+ }\r
+ else if (irmp_pause_time >= FDC_0_PAUSE_LEN_MIN && irmp_pause_time <= FDC_0_PAUSE_LEN_MAX)\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF (" 0 (FDC)\n");\r
+ ANALYZE_PRINTF (" 0 (FDC)\n");\r
#endif // ANALYZE\r
- irmp_store_bit2 (0);\r
- }\r
+ irmp_store_bit2 (0);\r
+ }\r
\r
- if (! irmp_param.protocol)\r
- {\r
+ if (! irmp_param.protocol)\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("Switching to FDC protocol\n");\r
+ ANALYZE_PRINTF ("Switching to FDC protocol\n");\r
#endif // ANALYZE\r
- memcpy (&irmp_param, &irmp_param2, sizeof (IRMP_PARAMETER));\r
- irmp_param2.protocol = 0;\r
- irmp_tmp_address = irmp_tmp_address2;\r
- irmp_tmp_command = irmp_tmp_command2;\r
- }\r
- }\r
+ memcpy (&irmp_param, &irmp_param2, sizeof (IRMP_PARAMETER));\r
+ irmp_param2.protocol = 0;\r
+ irmp_tmp_address = irmp_tmp_address2;\r
+ irmp_tmp_command = irmp_tmp_command2;\r
+ }\r
+ }\r
#endif // IRMP_SUPPORT_FDC_PROTOCOL == 1\r
#if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_RCCAR_PROTOCOL == 1\r
- if (irmp_param2.protocol == IRMP_RCCAR_PROTOCOL && irmp_pulse_time >= RCCAR_PULSE_LEN_MIN && irmp_pulse_time <= RCCAR_PULSE_LEN_MAX)\r
- {\r
- if (irmp_pause_time >= RCCAR_1_PAUSE_LEN_MIN && irmp_pause_time <= RCCAR_1_PAUSE_LEN_MAX)\r
- {\r
+ if (irmp_param2.protocol == IRMP_RCCAR_PROTOCOL && irmp_pulse_time >= RCCAR_PULSE_LEN_MIN && irmp_pulse_time <= RCCAR_PULSE_LEN_MAX)\r
+ {\r
+ if (irmp_pause_time >= RCCAR_1_PAUSE_LEN_MIN && irmp_pause_time <= RCCAR_1_PAUSE_LEN_MAX)\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF (" 1 (RCCAR)\n");\r
+ ANALYZE_PRINTF (" 1 (RCCAR)\n");\r
#endif // ANALYZE\r
- irmp_store_bit2 (1);\r
- }\r
- else if (irmp_pause_time >= RCCAR_0_PAUSE_LEN_MIN && irmp_pause_time <= RCCAR_0_PAUSE_LEN_MAX)\r
- {\r
+ irmp_store_bit2 (1);\r
+ }\r
+ else if (irmp_pause_time >= RCCAR_0_PAUSE_LEN_MIN && irmp_pause_time <= RCCAR_0_PAUSE_LEN_MAX)\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF (" 0 (RCCAR)\n");\r
+ ANALYZE_PRINTF (" 0 (RCCAR)\n");\r
#endif // ANALYZE\r
- irmp_store_bit2 (0);\r
- }\r
+ irmp_store_bit2 (0);\r
+ }\r
\r
- if (! irmp_param.protocol)\r
- {\r
+ if (! irmp_param.protocol)\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("Switching to RCCAR protocol\n");\r
+ ANALYZE_PRINTF ("Switching to RCCAR protocol\n");\r
#endif // ANALYZE\r
- memcpy (&irmp_param, &irmp_param2, sizeof (IRMP_PARAMETER));\r
- irmp_param2.protocol = 0;\r
- irmp_tmp_address = irmp_tmp_address2;\r
- irmp_tmp_command = irmp_tmp_command2;\r
- }\r
- }\r
+ memcpy (&irmp_param, &irmp_param2, sizeof (IRMP_PARAMETER));\r
+ irmp_param2.protocol = 0;\r
+ irmp_tmp_address = irmp_tmp_address2;\r
+ irmp_tmp_command = irmp_tmp_command2;\r
+ }\r
+ }\r
#endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1\r
\r
- last_pause = irmp_pause_time;\r
- wait_for_space = 0;\r
- }\r
- else\r
+ last_pause = irmp_pause_time;\r
+ wait_for_space = 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
-#ifdef ANALYZE\r
- ANALYZE_PUTCHAR ('1');\r
-#endif // ANALYZE\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
-#ifdef ANALYZE\r
- ANALYZE_PUTCHAR ('0');\r
-#endif // ANALYZE\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
-#ifdef ANALYZE\r
- ANALYZE_NEWLINE ();\r
-#endif // ANALYZE\r
- wait_for_space = 0;\r
- }\r
- else\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
+#ifdef ANALYZE\r
+ ANALYZE_PUTCHAR ('1');\r
+#endif // ANALYZE\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
+#ifdef ANALYZE\r
+ ANALYZE_PUTCHAR ('0');\r
+#endif // ANALYZE\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
+#ifdef ANALYZE\r
+ ANALYZE_NEWLINE ();\r
+#endif // ANALYZE\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
- {\r
- if (irmp_pulse_time >= SAMSUNG_PULSE_LEN_MIN && irmp_pulse_time <= SAMSUNG_PULSE_LEN_MAX &&\r
- irmp_pause_time >= SAMSUNG_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= SAMSUNG_START_BIT_PAUSE_LEN_MAX)\r
- {\r
-#ifdef ANALYZE\r
- ANALYZE_PRINTF ("SYNC\n");\r
-#endif // ANALYZE\r
- wait_for_space = 0;\r
- irmp_bit++;\r
- }\r
- else if (irmp_pulse_time >= SAMSUNG_PULSE_LEN_MIN && irmp_pulse_time <= SAMSUNG_PULSE_LEN_MAX)\r
- {\r
+ if (irmp_param.protocol == IRMP_SAMSUNG_PROTOCOL && irmp_bit == 16) // Samsung: 16th bit\r
+ {\r
+ if (irmp_pulse_time >= SAMSUNG_PULSE_LEN_MIN && irmp_pulse_time <= SAMSUNG_PULSE_LEN_MAX &&\r
+ irmp_pause_time >= SAMSUNG_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= SAMSUNG_START_BIT_PAUSE_LEN_MAX)\r
+ {\r
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("SYNC\n");\r
+#endif // ANALYZE\r
+ wait_for_space = 0;\r
+ irmp_bit++;\r
+ }\r
+ else if (irmp_pulse_time >= SAMSUNG_PULSE_LEN_MIN && irmp_pulse_time <= SAMSUNG_PULSE_LEN_MAX)\r
+ {\r
#if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("Switching to SAMSUNG48 protocol ");\r
+ ANALYZE_PRINTF ("Switching to SAMSUNG48 protocol ");\r
#endif // ANALYZE\r
- irmp_param.protocol = IRMP_SAMSUNG48_PROTOCOL;\r
- irmp_param.command_offset = SAMSUNG48_COMMAND_OFFSET;\r
- irmp_param.command_end = SAMSUNG48_COMMAND_OFFSET + SAMSUNG48_COMMAND_LEN;\r
- irmp_param.complete_len = SAMSUNG48_COMPLETE_DATA_LEN;\r
+ irmp_param.protocol = IRMP_SAMSUNG48_PROTOCOL;\r
+ irmp_param.command_offset = SAMSUNG48_COMMAND_OFFSET;\r
+ irmp_param.command_end = SAMSUNG48_COMMAND_OFFSET + SAMSUNG48_COMMAND_LEN;\r
+ irmp_param.complete_len = SAMSUNG48_COMPLETE_DATA_LEN;\r
#else\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("Switching to SAMSUNG32 protocol ");\r
+ ANALYZE_PRINTF ("Switching to SAMSUNG32 protocol ");\r
#endif // ANALYZE\r
- irmp_param.protocol = IRMP_SAMSUNG32_PROTOCOL;\r
- irmp_param.command_offset = SAMSUNG32_COMMAND_OFFSET;\r
- irmp_param.command_end = SAMSUNG32_COMMAND_OFFSET + SAMSUNG32_COMMAND_LEN;\r
- irmp_param.complete_len = SAMSUNG32_COMPLETE_DATA_LEN;\r
+ irmp_param.protocol = IRMP_SAMSUNG32_PROTOCOL;\r
+ irmp_param.command_offset = SAMSUNG32_COMMAND_OFFSET;\r
+ irmp_param.command_end = SAMSUNG32_COMMAND_OFFSET + SAMSUNG32_COMMAND_LEN;\r
+ irmp_param.complete_len = SAMSUNG32_COMPLETE_DATA_LEN;\r
#endif\r
- if (irmp_pause_time >= SAMSUNG_1_PAUSE_LEN_MIN && irmp_pause_time <= SAMSUNG_1_PAUSE_LEN_MAX)\r
- {\r
-#ifdef ANALYZE\r
- ANALYZE_PUTCHAR ('1');\r
- ANALYZE_NEWLINE ();\r
-#endif // ANALYZE\r
- irmp_store_bit (1);\r
- wait_for_space = 0;\r
- }\r
- else\r
- {\r
-#ifdef ANALYZE\r
- ANALYZE_PUTCHAR ('0');\r
- ANALYZE_NEWLINE ();\r
-#endif // ANALYZE\r
- irmp_store_bit (0);\r
- wait_for_space = 0;\r
- }\r
- }\r
- else\r
- { // timing incorrect!\r
-#ifdef ANALYZE\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
-#endif // ANALYZE\r
- irmp_start_bit_detected = 0; // reset flags and wait for next start bit\r
- irmp_pause_time = 0;\r
- }\r
- }\r
- else\r
+ if (irmp_pause_time >= SAMSUNG_1_PAUSE_LEN_MIN && irmp_pause_time <= SAMSUNG_1_PAUSE_LEN_MAX)\r
+ {\r
+#ifdef ANALYZE\r
+ ANALYZE_PUTCHAR ('1');\r
+ ANALYZE_NEWLINE ();\r
+#endif // ANALYZE\r
+ irmp_store_bit (1);\r
+ wait_for_space = 0;\r
+ }\r
+ else\r
+ {\r
+#ifdef ANALYZE\r
+ ANALYZE_PUTCHAR ('0');\r
+ ANALYZE_NEWLINE ();\r
+#endif // ANALYZE\r
+ irmp_store_bit (0);\r
+ wait_for_space = 0;\r
+ }\r
+ }\r
+ else\r
+ { // timing incorrect!\r
+#ifdef ANALYZE\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
+#endif // ANALYZE\r
+ irmp_start_bit_detected = 0; // reset flags and wait for next start bit\r
+ irmp_pause_time = 0;\r
+ }\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
+ if (irmp_param.protocol == IRMP_NEC42_PROTOCOL &&\r
#else // IRMP_SUPPORT_NEC_PROTOCOL instead\r
- if (irmp_param.protocol == IRMP_NEC_PROTOCOL &&\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
-#ifdef ANALYZE\r
- ANALYZE_PRINTF ("Switching to NEC16 protocol\n");\r
-#endif // ANALYZE\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
+ irmp_bit == 8 && irmp_pause_time >= NEC_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= NEC_START_BIT_PAUSE_LEN_MAX)\r
+ {\r
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("Switching to NEC16 protocol\n");\r
+#endif // ANALYZE\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
- if (irmp_pulse_time >= BANG_OLUFSEN_PULSE_LEN_MIN && irmp_pulse_time <= BANG_OLUFSEN_PULSE_LEN_MAX)\r
- {\r
- if (irmp_bit == 1) // Bang & Olufsen: 3rd bit\r
- {\r
- if (irmp_pause_time >= BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN && irmp_pause_time <= BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX)\r
- {\r
-#ifdef ANALYZE\r
- ANALYZE_PRINTF ("3rd start bit\n");\r
-#endif // ANALYZE\r
- wait_for_space = 0;\r
- irmp_bit++;\r
- }\r
- else\r
- { // timing incorrect!\r
-#ifdef ANALYZE\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
-#endif // ANALYZE\r
- irmp_start_bit_detected = 0; // reset flags and wait for next start bit\r
- irmp_pause_time = 0;\r
- }\r
- }\r
- else if (irmp_bit == 19) // Bang & Olufsen: trailer bit\r
- {\r
- if (irmp_pause_time >= BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MIN && irmp_pause_time <= BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MAX)\r
- {\r
-#ifdef ANALYZE\r
- ANALYZE_PRINTF ("trailer bit\n");\r
-#endif // ANALYZE\r
- wait_for_space = 0;\r
- irmp_bit++;\r
- }\r
- else\r
- { // timing incorrect!\r
-#ifdef ANALYZE\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
-#endif // ANALYZE\r
- irmp_start_bit_detected = 0; // reset flags and wait for next start bit\r
- irmp_pause_time = 0;\r
- }\r
- }\r
- else\r
- {\r
- if (irmp_pause_time >= BANG_OLUFSEN_1_PAUSE_LEN_MIN && irmp_pause_time <= BANG_OLUFSEN_1_PAUSE_LEN_MAX)\r
- { // pulse & pause timings correct for "1"?\r
-#ifdef ANALYZE\r
- ANALYZE_PUTCHAR ('1');\r
- ANALYZE_NEWLINE ();\r
-#endif // ANALYZE\r
- irmp_store_bit (1);\r
- last_value = 1;\r
- wait_for_space = 0;\r
- }\r
- else if (irmp_pause_time >= BANG_OLUFSEN_0_PAUSE_LEN_MIN && irmp_pause_time <= BANG_OLUFSEN_0_PAUSE_LEN_MAX)\r
- { // pulse & pause timings correct for "0"?\r
-#ifdef ANALYZE\r
- ANALYZE_PUTCHAR ('0');\r
- ANALYZE_NEWLINE ();\r
-#endif // ANALYZE\r
- irmp_store_bit (0);\r
- last_value = 0;\r
- wait_for_space = 0;\r
- }\r
- else if (irmp_pause_time >= BANG_OLUFSEN_R_PAUSE_LEN_MIN && irmp_pause_time <= BANG_OLUFSEN_R_PAUSE_LEN_MAX)\r
- {\r
-#ifdef ANALYZE\r
- ANALYZE_PUTCHAR (last_value + '0');\r
- ANALYZE_NEWLINE ();\r
-#endif // ANALYZE\r
- irmp_store_bit (last_value);\r
- wait_for_space = 0;\r
- }\r
- else\r
- { // timing incorrect!\r
-#ifdef ANALYZE\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
-#endif // ANALYZE\r
- irmp_start_bit_detected = 0; // reset flags and wait for next start bit\r
- irmp_pause_time = 0;\r
- }\r
- }\r
- }\r
- else\r
- { // timing incorrect!\r
-#ifdef ANALYZE\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
-#endif // ANALYZE\r
- irmp_start_bit_detected = 0; // reset flags and wait for next start bit\r
- irmp_pause_time = 0;\r
- }\r
- }\r
- else\r
+ if (irmp_param.protocol == IRMP_BANG_OLUFSEN_PROTOCOL)\r
+ {\r
+ if (irmp_pulse_time >= BANG_OLUFSEN_PULSE_LEN_MIN && irmp_pulse_time <= BANG_OLUFSEN_PULSE_LEN_MAX)\r
+ {\r
+ if (irmp_bit == 1) // Bang & Olufsen: 3rd bit\r
+ {\r
+ if (irmp_pause_time >= BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN && irmp_pause_time <= BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX)\r
+ {\r
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("3rd start bit\n");\r
+#endif // ANALYZE\r
+ wait_for_space = 0;\r
+ irmp_bit++;\r
+ }\r
+ else\r
+ { // timing incorrect!\r
+#ifdef ANALYZE\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
+#endif // ANALYZE\r
+ irmp_start_bit_detected = 0; // reset flags and wait for next start bit\r
+ irmp_pause_time = 0;\r
+ }\r
+ }\r
+ else if (irmp_bit == 19) // Bang & Olufsen: trailer bit\r
+ {\r
+ if (irmp_pause_time >= BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MIN && irmp_pause_time <= BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MAX)\r
+ {\r
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("trailer bit\n");\r
+#endif // ANALYZE\r
+ wait_for_space = 0;\r
+ irmp_bit++;\r
+ }\r
+ else\r
+ { // timing incorrect!\r
+#ifdef ANALYZE\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
+#endif // ANALYZE\r
+ irmp_start_bit_detected = 0; // reset flags and wait for next start bit\r
+ irmp_pause_time = 0;\r
+ }\r
+ }\r
+ else\r
+ {\r
+ if (irmp_pause_time >= BANG_OLUFSEN_1_PAUSE_LEN_MIN && irmp_pause_time <= BANG_OLUFSEN_1_PAUSE_LEN_MAX)\r
+ { // pulse & pause timings correct for "1"?\r
+#ifdef ANALYZE\r
+ ANALYZE_PUTCHAR ('1');\r
+ ANALYZE_NEWLINE ();\r
+#endif // ANALYZE\r
+ irmp_store_bit (1);\r
+ last_value = 1;\r
+ wait_for_space = 0;\r
+ }\r
+ else if (irmp_pause_time >= BANG_OLUFSEN_0_PAUSE_LEN_MIN && irmp_pause_time <= BANG_OLUFSEN_0_PAUSE_LEN_MAX)\r
+ { // pulse & pause timings correct for "0"?\r
+#ifdef ANALYZE\r
+ ANALYZE_PUTCHAR ('0');\r
+ ANALYZE_NEWLINE ();\r
+#endif // ANALYZE\r
+ irmp_store_bit (0);\r
+ last_value = 0;\r
+ wait_for_space = 0;\r
+ }\r
+ else if (irmp_pause_time >= BANG_OLUFSEN_R_PAUSE_LEN_MIN && irmp_pause_time <= BANG_OLUFSEN_R_PAUSE_LEN_MAX)\r
+ {\r
+#ifdef ANALYZE\r
+ ANALYZE_PUTCHAR (last_value + '0');\r
+ ANALYZE_NEWLINE ();\r
+#endif // ANALYZE\r
+ irmp_store_bit (last_value);\r
+ wait_for_space = 0;\r
+ }\r
+ else\r
+ { // timing incorrect!\r
+#ifdef ANALYZE\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
+#endif // ANALYZE\r
+ irmp_start_bit_detected = 0; // reset flags and wait for next start bit\r
+ irmp_pause_time = 0;\r
+ }\r
+ }\r
+ }\r
+ else\r
+ { // timing incorrect!\r
+#ifdef ANALYZE\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
+#endif // ANALYZE\r
+ irmp_start_bit_detected = 0; // reset flags and wait for next start bit\r
+ irmp_pause_time = 0;\r
+ }\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL\r
\r
#if IRMP_SUPPORT_RCMM_PROTOCOL == 1\r
- if (irmp_param.protocol == IRMP_RCMM32_PROTOCOL)\r
- {\r
- if (irmp_pause_time >= RCMM32_BIT_00_PAUSE_LEN_MIN && irmp_pause_time <= RCMM32_BIT_00_PAUSE_LEN_MAX)\r
- {\r
-#ifdef ANALYZE\r
- ANALYZE_PUTCHAR ('0');\r
- ANALYZE_PUTCHAR ('0');\r
-#endif // ANALYZE\r
- irmp_store_bit (0);\r
- irmp_store_bit (0);\r
- }\r
- else if (irmp_pause_time >= RCMM32_BIT_01_PAUSE_LEN_MIN && irmp_pause_time <= RCMM32_BIT_01_PAUSE_LEN_MAX)\r
- {\r
-#ifdef ANALYZE\r
- ANALYZE_PUTCHAR ('0');\r
- ANALYZE_PUTCHAR ('1');\r
-#endif // ANALYZE\r
- irmp_store_bit (0);\r
- irmp_store_bit (1);\r
- }\r
- else if (irmp_pause_time >= RCMM32_BIT_10_PAUSE_LEN_MIN && irmp_pause_time <= RCMM32_BIT_10_PAUSE_LEN_MAX)\r
- {\r
-#ifdef ANALYZE\r
- ANALYZE_PUTCHAR ('1');\r
- ANALYZE_PUTCHAR ('0');\r
-#endif // ANALYZE\r
- irmp_store_bit (1);\r
- irmp_store_bit (0);\r
- }\r
- else if (irmp_pause_time >= RCMM32_BIT_11_PAUSE_LEN_MIN && irmp_pause_time <= RCMM32_BIT_11_PAUSE_LEN_MAX)\r
- {\r
-#ifdef ANALYZE\r
- ANALYZE_PUTCHAR ('1');\r
- ANALYZE_PUTCHAR ('1');\r
-#endif // ANALYZE\r
- irmp_store_bit (1);\r
- irmp_store_bit (1);\r
- }\r
-#ifdef ANALYZE\r
- ANALYZE_PRINTF ("\n");\r
-#endif // ANALYZE\r
- wait_for_space = 0;\r
- }\r
- else\r
+ if (irmp_param.protocol == IRMP_RCMM32_PROTOCOL)\r
+ {\r
+ if (irmp_pause_time >= RCMM32_BIT_00_PAUSE_LEN_MIN && irmp_pause_time <= RCMM32_BIT_00_PAUSE_LEN_MAX)\r
+ {\r
+#ifdef ANALYZE\r
+ ANALYZE_PUTCHAR ('0');\r
+ ANALYZE_PUTCHAR ('0');\r
+#endif // ANALYZE\r
+ irmp_store_bit (0);\r
+ irmp_store_bit (0);\r
+ }\r
+ else if (irmp_pause_time >= RCMM32_BIT_01_PAUSE_LEN_MIN && irmp_pause_time <= RCMM32_BIT_01_PAUSE_LEN_MAX)\r
+ {\r
+#ifdef ANALYZE\r
+ ANALYZE_PUTCHAR ('0');\r
+ ANALYZE_PUTCHAR ('1');\r
+#endif // ANALYZE\r
+ irmp_store_bit (0);\r
+ irmp_store_bit (1);\r
+ }\r
+ else if (irmp_pause_time >= RCMM32_BIT_10_PAUSE_LEN_MIN && irmp_pause_time <= RCMM32_BIT_10_PAUSE_LEN_MAX)\r
+ {\r
+#ifdef ANALYZE\r
+ ANALYZE_PUTCHAR ('1');\r
+ ANALYZE_PUTCHAR ('0');\r
+#endif // ANALYZE\r
+ irmp_store_bit (1);\r
+ irmp_store_bit (0);\r
+ }\r
+ else if (irmp_pause_time >= RCMM32_BIT_11_PAUSE_LEN_MIN && irmp_pause_time <= RCMM32_BIT_11_PAUSE_LEN_MAX)\r
+ {\r
+#ifdef ANALYZE\r
+ ANALYZE_PUTCHAR ('1');\r
+ ANALYZE_PUTCHAR ('1');\r
+#endif // ANALYZE\r
+ irmp_store_bit (1);\r
+ irmp_store_bit (1);\r
+ }\r
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("\n");\r
+#endif // ANALYZE\r
+ wait_for_space = 0;\r
+ }\r
+ else\r
#endif\r
\r
- if (irmp_pulse_time >= irmp_param.pulse_1_len_min && irmp_pulse_time <= irmp_param.pulse_1_len_max &&\r
- irmp_pause_time >= irmp_param.pause_1_len_min && irmp_pause_time <= irmp_param.pause_1_len_max)\r
- { // pulse & pause timings correct for "1"?\r
+ if (irmp_pulse_time >= irmp_param.pulse_1_len_min && irmp_pulse_time <= irmp_param.pulse_1_len_max &&\r
+ irmp_pause_time >= irmp_param.pause_1_len_min && irmp_pause_time <= irmp_param.pause_1_len_max)\r
+ { // pulse & pause timings correct for "1"?\r
#ifdef ANALYZE\r
- ANALYZE_PUTCHAR ('1');\r
- ANALYZE_NEWLINE ();\r
+ ANALYZE_PUTCHAR ('1');\r
+ ANALYZE_NEWLINE ();\r
#endif // ANALYZE\r
- irmp_store_bit (1);\r
- wait_for_space = 0;\r
- }\r
- else if (irmp_pulse_time >= irmp_param.pulse_0_len_min && irmp_pulse_time <= irmp_param.pulse_0_len_max &&\r
- irmp_pause_time >= irmp_param.pause_0_len_min && irmp_pause_time <= irmp_param.pause_0_len_max)\r
- { // pulse & pause timings correct for "0"?\r
+ irmp_store_bit (1);\r
+ wait_for_space = 0;\r
+ }\r
+ else if (irmp_pulse_time >= irmp_param.pulse_0_len_min && irmp_pulse_time <= irmp_param.pulse_0_len_max &&\r
+ irmp_pause_time >= irmp_param.pause_0_len_min && irmp_pause_time <= irmp_param.pause_0_len_max)\r
+ { // pulse & pause timings correct for "0"?\r
#ifdef ANALYZE\r
- ANALYZE_PUTCHAR ('0');\r
- ANALYZE_NEWLINE ();\r
+ ANALYZE_PUTCHAR ('0');\r
+ ANALYZE_NEWLINE ();\r
#endif // ANALYZE\r
- irmp_store_bit (0);\r
- wait_for_space = 0;\r
- }\r
- else\r
+ irmp_store_bit (0);\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
-#ifdef ANALYZE\r
- ANALYZE_PUTCHAR ('S');\r
- ANALYZE_NEWLINE ();\r
-#endif // ANALYZE\r
- irmp_tmp_command <<= 1;\r
- }\r
- else\r
- {\r
-#ifdef ANALYZE\r
- ANALYZE_PUTCHAR ('S');\r
- ANALYZE_NEWLINE ();\r
-#endif // ANALYZE\r
- irmp_store_bit (1);\r
- }\r
- wait_for_space = 0;\r
- }\r
- else\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
+#ifdef ANALYZE\r
+ ANALYZE_PUTCHAR ('S');\r
+ ANALYZE_NEWLINE ();\r
+#endif // ANALYZE\r
+ irmp_tmp_command <<= 1;\r
+ }\r
+ else\r
+ {\r
+#ifdef ANALYZE\r
+ ANALYZE_PUTCHAR ('S');\r
+ ANALYZE_NEWLINE ();\r
+#endif // ANALYZE\r
+ irmp_store_bit (1);\r
+ }\r
+ wait_for_space = 0;\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_KATHREIN_PROTOCOL\r
- { // timing incorrect!\r
-#ifdef ANALYZE\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
-#endif // ANALYZE\r
- irmp_start_bit_detected = 0; // reset flags and wait for next start bit\r
- irmp_pause_time = 0;\r
- }\r
-\r
- irmp_pulse_time = 1; // set counter to 1, not 0\r
- }\r
- }\r
- else\r
- { // counting the pulse length ...\r
- if (! irmp_input) // still light?\r
- { // yes...\r
- irmp_pulse_time++; // increment counter\r
- }\r
- else\r
- { // now it's dark!\r
- wait_for_space = 1; // let's count the time (see above)\r
- irmp_pause_time = 1; // set pause counter to 1, not 0\r
- }\r
- }\r
-\r
- if (irmp_start_bit_detected && irmp_bit == irmp_param.complete_len && irmp_param.stop_bit == 0) // enough bits received?\r
- {\r
- if (last_irmp_command == irmp_tmp_command && key_repetition_len < AUTO_FRAME_REPETITION_LEN)\r
- {\r
- repetition_frame_number++;\r
- }\r
- else\r
- {\r
- repetition_frame_number = 0;\r
- }\r
+ { // timing incorrect!\r
+#ifdef ANALYZE\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
+#endif // ANALYZE\r
+ irmp_start_bit_detected = 0; // reset flags and wait for next start bit\r
+ irmp_pause_time = 0;\r
+ }\r
+\r
+ irmp_pulse_time = 1; // set counter to 1, not 0\r
+ }\r
+ }\r
+ else\r
+ { // counting the pulse length ...\r
+ if (! irmp_input) // still light?\r
+ { // yes...\r
+ irmp_pulse_time++; // increment counter\r
+ }\r
+ else\r
+ { // now it's dark!\r
+ wait_for_space = 1; // let's count the time (see above)\r
+ irmp_pause_time = 1; // set pause counter to 1, not 0\r
+ }\r
+ }\r
+\r
+ if (irmp_start_bit_detected && irmp_bit == irmp_param.complete_len && irmp_param.stop_bit == 0) // enough bits received?\r
+ {\r
+ if (last_irmp_command == irmp_tmp_command && key_repetition_len < AUTO_FRAME_REPETITION_LEN)\r
+ {\r
+ repetition_frame_number++;\r
+ }\r
+ else\r
+ {\r
+ repetition_frame_number = 0;\r
+ }\r
\r
#if IRMP_SUPPORT_SIRCS_PROTOCOL == 1\r
- // if SIRCS protocol and the code will be repeated within 50 ms, we will ignore 2nd and 3rd repetition frame\r
- if (irmp_param.protocol == IRMP_SIRCS_PROTOCOL && (repetition_frame_number == 1 || repetition_frame_number == 2))\r
- {\r
+ // if SIRCS protocol and the code will be repeated within 50 ms, we will ignore 2nd and 3rd repetition frame\r
+ if (irmp_param.protocol == IRMP_SIRCS_PROTOCOL && (repetition_frame_number == 1 || repetition_frame_number == 2))\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("code skipped: SIRCS auto repetition frame #%d, counter = %d, auto repetition len = %d\n",\r
- repetition_frame_number + 1, key_repetition_len, AUTO_FRAME_REPETITION_LEN);\r
+ ANALYZE_PRINTF ("code skipped: SIRCS auto repetition frame #%d, counter = %d, auto repetition len = %d\n",\r
+ repetition_frame_number + 1, key_repetition_len, AUTO_FRAME_REPETITION_LEN);\r
#endif // ANALYZE\r
- key_repetition_len = 0;\r
- }\r
- else\r
+ key_repetition_len = 0;\r
+ }\r
+ else\r
#endif\r
\r
#if IRMP_SUPPORT_ORTEK_PROTOCOL == 1\r
- // if ORTEK protocol and the code will be repeated within 50 ms, we will ignore 2nd repetition frame\r
- if (irmp_param.protocol == IRMP_ORTEK_PROTOCOL && repetition_frame_number == 1)\r
- {\r
+ // if ORTEK protocol and the code will be repeated within 50 ms, we will ignore 2nd repetition frame\r
+ if (irmp_param.protocol == IRMP_ORTEK_PROTOCOL && repetition_frame_number == 1)\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("code skipped: ORTEK auto repetition frame #%d, counter = %d, auto repetition len = %d\n",\r
- repetition_frame_number + 1, key_repetition_len, AUTO_FRAME_REPETITION_LEN);\r
+ ANALYZE_PRINTF ("code skipped: ORTEK auto repetition frame #%d, counter = %d, auto repetition len = %d\n",\r
+ repetition_frame_number + 1, key_repetition_len, AUTO_FRAME_REPETITION_LEN);\r
#endif // ANALYZE\r
- key_repetition_len = 0;\r
- }\r
- else\r
+ key_repetition_len = 0;\r
+ }\r
+ else\r
#endif\r
\r
#if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1\r
- // if KASEIKYO protocol and the code will be repeated within 50 ms, we will ignore 2nd repetition frame\r
- if (irmp_param.protocol == IRMP_KASEIKYO_PROTOCOL && repetition_frame_number == 1)\r
- {\r
+ // if KASEIKYO protocol and the code will be repeated within 50 ms, we will ignore 2nd repetition frame\r
+ if (irmp_param.protocol == IRMP_KASEIKYO_PROTOCOL && repetition_frame_number == 1)\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("code skipped: KASEIKYO auto repetition frame #%d, counter = %d, auto repetition len = %d\n",\r
- repetition_frame_number + 1, key_repetition_len, AUTO_FRAME_REPETITION_LEN);\r
+ ANALYZE_PRINTF ("code skipped: KASEIKYO auto repetition frame #%d, counter = %d, auto repetition len = %d\n",\r
+ repetition_frame_number + 1, key_repetition_len, AUTO_FRAME_REPETITION_LEN);\r
#endif // ANALYZE\r
- key_repetition_len = 0;\r
- }\r
- else\r
+ key_repetition_len = 0;\r
+ }\r
+ else\r
#endif\r
\r
#if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1\r
- // if SAMSUNG32 or SAMSUNG48 protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame\r
- if ((irmp_param.protocol == IRMP_SAMSUNG32_PROTOCOL || irmp_param.protocol == IRMP_SAMSUNG48_PROTOCOL) && (repetition_frame_number & 0x01))\r
- {\r
+ // if SAMSUNG32 or SAMSUNG48 protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame\r
+ if ((irmp_param.protocol == IRMP_SAMSUNG32_PROTOCOL || irmp_param.protocol == IRMP_SAMSUNG48_PROTOCOL) && (repetition_frame_number & 0x01))\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("code skipped: SAMSUNG32/SAMSUNG48 auto repetition frame #%d, counter = %d, auto repetition len = %d\n",\r
- repetition_frame_number + 1, key_repetition_len, AUTO_FRAME_REPETITION_LEN);\r
+ ANALYZE_PRINTF ("code skipped: SAMSUNG32/SAMSUNG48 auto repetition frame #%d, counter = %d, auto repetition len = %d\n",\r
+ repetition_frame_number + 1, key_repetition_len, AUTO_FRAME_REPETITION_LEN);\r
#endif // ANALYZE\r
- key_repetition_len = 0;\r
- }\r
- else\r
+ key_repetition_len = 0;\r
+ }\r
+ else\r
#endif\r
\r
#if IRMP_SUPPORT_NUBERT_PROTOCOL == 1\r
- // if NUBERT protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame\r
- if (irmp_param.protocol == IRMP_NUBERT_PROTOCOL && (repetition_frame_number & 0x01))\r
- {\r
+ // if NUBERT protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame\r
+ if (irmp_param.protocol == IRMP_NUBERT_PROTOCOL && (repetition_frame_number & 0x01))\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("code skipped: NUBERT auto repetition frame #%d, counter = %d, auto repetition len = %d\n",\r
- repetition_frame_number + 1, key_repetition_len, AUTO_FRAME_REPETITION_LEN);\r
+ ANALYZE_PRINTF ("code skipped: NUBERT auto repetition frame #%d, counter = %d, auto repetition len = %d\n",\r
+ repetition_frame_number + 1, key_repetition_len, AUTO_FRAME_REPETITION_LEN);\r
#endif // ANALYZE\r
- key_repetition_len = 0;\r
- }\r
- else\r
+ key_repetition_len = 0;\r
+ }\r
+ else\r
#endif\r
\r
#if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1\r
- // if SPEAKER protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame\r
- if (irmp_param.protocol == IRMP_SPEAKER_PROTOCOL && (repetition_frame_number & 0x01))\r
- {\r
+ // if SPEAKER protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame\r
+ if (irmp_param.protocol == IRMP_SPEAKER_PROTOCOL && (repetition_frame_number & 0x01))\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("code skipped: SPEAKER auto repetition frame #%d, counter = %d, auto repetition len = %d\n",\r
- repetition_frame_number + 1, key_repetition_len, AUTO_FRAME_REPETITION_LEN);\r
+ ANALYZE_PRINTF ("code skipped: SPEAKER auto repetition frame #%d, counter = %d, auto repetition len = %d\n",\r
+ repetition_frame_number + 1, key_repetition_len, AUTO_FRAME_REPETITION_LEN);\r
#endif // ANALYZE\r
- key_repetition_len = 0;\r
- }\r
- else\r
+ key_repetition_len = 0;\r
+ }\r
+ else\r
#endif\r
\r
- {\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("%8.3fms code detected, length = %d\n", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_bit);\r
+ ANALYZE_PRINTF ("%8.3fms code detected, length = %d\n", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_bit);\r
#endif // ANALYZE\r
- irmp_ir_detected = TRUE;\r
+ irmp_ir_detected = TRUE;\r
\r
#if IRMP_SUPPORT_DENON_PROTOCOL == 1\r
- if (irmp_param.protocol == IRMP_DENON_PROTOCOL)\r
- { // check for repetition frame\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
- irmp_command = irmp_tmp_command; // store command\r
- }\r
- else\r
- {\r
- if ((irmp_tmp_command & 0x01) == 0x00)\r
- {\r
-#ifdef ANALYZE\r
- ANALYZE_PRINTF ("%8.3fms info Denon: waiting for inverted command repetition\n", (double) (time_counter * 1000) / F_INTERRUPTS);\r
-#endif // ANALYZE\r
- last_irmp_denon_command = irmp_tmp_command;\r
- denon_repetition_len = 0;\r
- irmp_ir_detected = FALSE;\r
- }\r
- else\r
- {\r
-#ifdef ANALYZE\r
- ANALYZE_PRINTF ("%8.3fms warning Denon: got unexpected inverted command, ignoring it\n", (double) (time_counter * 1000) / F_INTERRUPTS);\r
-#endif // ANALYZE\r
- last_irmp_denon_command = 0;\r
- irmp_ir_detected = FALSE;\r
- }\r
- }\r
- }\r
- else\r
+ if (irmp_param.protocol == IRMP_DENON_PROTOCOL)\r
+ { // check for repetition frame\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
+ irmp_command = irmp_tmp_command; // store command\r
+ }\r
+ else\r
+ {\r
+ if ((irmp_tmp_command & 0x01) == 0x00)\r
+ {\r
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("%8.3fms info Denon: waiting for inverted command repetition\n", (double) (time_counter * 1000) / F_INTERRUPTS);\r
+#endif // ANALYZE\r
+ last_irmp_denon_command = irmp_tmp_command;\r
+ denon_repetition_len = 0;\r
+ irmp_ir_detected = FALSE;\r
+ }\r
+ else\r
+ {\r
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("%8.3fms warning Denon: got unexpected inverted command, ignoring it\n", (double) (time_counter * 1000) / F_INTERRUPTS);\r
+#endif // ANALYZE\r
+ last_irmp_denon_command = 0;\r
+ irmp_ir_detected = FALSE;\r
+ }\r
+ }\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_DENON_PROTOCOL\r
\r
#if IRMP_SUPPORT_GRUNDIG_PROTOCOL == 1\r
- if (irmp_param.protocol == IRMP_GRUNDIG_PROTOCOL && irmp_tmp_command == 0x01ff)\r
- { // Grundig start frame?\r
+ if (irmp_param.protocol == IRMP_GRUNDIG_PROTOCOL && irmp_tmp_command == 0x01ff)\r
+ { // Grundig start frame?\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("Detected GRUNDIG start frame, ignoring it\n");\r
+ ANALYZE_PRINTF ("Detected GRUNDIG start frame, ignoring it\n");\r
#endif // ANALYZE\r
- irmp_ir_detected = FALSE;\r
- }\r
- else\r
+ irmp_ir_detected = FALSE;\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_GRUNDIG_PROTOCOL\r
\r
#if IRMP_SUPPORT_NOKIA_PROTOCOL == 1\r
- if (irmp_param.protocol == IRMP_NOKIA_PROTOCOL && irmp_tmp_address == 0x00ff && irmp_tmp_command == 0x00fe)\r
- { // Nokia start frame?\r
+ if (irmp_param.protocol == IRMP_NOKIA_PROTOCOL && irmp_tmp_address == 0x00ff && irmp_tmp_command == 0x00fe)\r
+ { // Nokia start frame?\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("Detected NOKIA start frame, ignoring it\n");\r
+ ANALYZE_PRINTF ("Detected NOKIA start frame, ignoring it\n");\r
#endif // ANALYZE\r
- irmp_ir_detected = FALSE;\r
- }\r
- else\r
+ irmp_ir_detected = FALSE;\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_NOKIA_PROTOCOL\r
- {\r
+ {\r
#if IRMP_SUPPORT_NEC_PROTOCOL == 1\r
- if (irmp_param.protocol == IRMP_NEC_PROTOCOL && irmp_bit == 0) // repetition frame\r
- {\r
- if (key_repetition_len < NEC_FRAME_REPEAT_PAUSE_LEN_MAX)\r
- {\r
-#ifdef ANALYZE\r
- ANALYZE_PRINTF ("Detected NEC repetition frame, key_repetition_len = %d\n", key_repetition_len);\r
- ANALYZE_ONLY_NORMAL_PRINTF("REPETETION FRAME ");\r
-#endif // ANALYZE\r
- irmp_tmp_address = last_irmp_address; // address is last address\r
- irmp_tmp_command = last_irmp_command; // command is last command\r
- irmp_flags |= IRMP_FLAG_REPETITION;\r
- key_repetition_len = 0;\r
- }\r
- else\r
- {\r
-#ifdef ANALYZE\r
- ANALYZE_PRINTF ("Detected NEC repetition frame, ignoring it: timeout occured, key_repetition_len = %d > %d\n",\r
- key_repetition_len, NEC_FRAME_REPEAT_PAUSE_LEN_MAX);\r
-#endif // ANALYZE\r
- irmp_ir_detected = FALSE;\r
- }\r
- }\r
+ if (irmp_param.protocol == IRMP_NEC_PROTOCOL && irmp_bit == 0) // repetition frame\r
+ {\r
+ if (key_repetition_len < NEC_FRAME_REPEAT_PAUSE_LEN_MAX)\r
+ {\r
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("Detected NEC repetition frame, key_repetition_len = %d\n", key_repetition_len);\r
+ ANALYZE_ONLY_NORMAL_PRINTF("REPETETION FRAME ");\r
+#endif // ANALYZE\r
+ irmp_tmp_address = last_irmp_address; // address is last address\r
+ irmp_tmp_command = last_irmp_command; // command is last command\r
+ irmp_flags |= IRMP_FLAG_REPETITION;\r
+ key_repetition_len = 0;\r
+ }\r
+ else\r
+ {\r
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("Detected NEC repetition frame, ignoring it: timeout occured, key_repetition_len = %d > %d\n",\r
+ key_repetition_len, NEC_FRAME_REPEAT_PAUSE_LEN_MAX);\r
+#endif // ANALYZE\r
+ irmp_ir_detected = FALSE;\r
+ }\r
+ }\r
#endif // IRMP_SUPPORT_NEC_PROTOCOL\r
\r
#if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1\r
- if (irmp_param.protocol == IRMP_KASEIKYO_PROTOCOL)\r
- {\r
- uint_fast8_t xor_value;\r
+ if (irmp_param.protocol == IRMP_KASEIKYO_PROTOCOL)\r
+ {\r
+ uint_fast8_t xor_value;\r
\r
- xor_value = (xor_check[0] & 0x0F) ^ ((xor_check[0] & 0xF0) >> 4) ^ (xor_check[1] & 0x0F) ^ ((xor_check[1] & 0xF0) >> 4);\r
+ xor_value = (xor_check[0] & 0x0F) ^ ((xor_check[0] & 0xF0) >> 4) ^ (xor_check[1] & 0x0F) ^ ((xor_check[1] & 0xF0) >> 4);\r
\r
- if (xor_value != (xor_check[2] & 0x0F))\r
- {\r
+ if (xor_value != (xor_check[2] & 0x0F))\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("error 4: wrong XOR check for customer id: 0x%1x 0x%1x\n", xor_value, xor_check[2] & 0x0F);\r
+ ANALYZE_PRINTF ("error 4: wrong XOR check for customer id: 0x%1x 0x%1x\n", xor_value, xor_check[2] & 0x0F);\r
#endif // ANALYZE\r
- irmp_ir_detected = FALSE;\r
- }\r
+ irmp_ir_detected = FALSE;\r
+ }\r
\r
- xor_value = xor_check[2] ^ xor_check[3] ^ xor_check[4];\r
+ xor_value = xor_check[2] ^ xor_check[3] ^ xor_check[4];\r
\r
- if (xor_value != xor_check[5])\r
- {\r
+ if (xor_value != xor_check[5])\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("error 5: wrong XOR check for data bits: 0x%02x 0x%02x\n", xor_value, xor_check[5]);\r
+ ANALYZE_PRINTF ("error 5: wrong XOR check for data bits: 0x%02x 0x%02x\n", xor_value, xor_check[5]);\r
#endif // ANALYZE\r
- irmp_ir_detected = FALSE;\r
- }\r
+ irmp_ir_detected = FALSE;\r
+ }\r
\r
- irmp_flags |= genre2; // write the genre2 bits into MSB of the flag byte\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
#if IRMP_SUPPORT_ORTEK_PROTOCOL == 1\r
- if (irmp_param.protocol == IRMP_ORTEK_PROTOCOL)\r
- {\r
- if (parity == PARITY_CHECK_FAILED)\r
- {\r
+ if (irmp_param.protocol == IRMP_ORTEK_PROTOCOL)\r
+ {\r
+ if (parity == PARITY_CHECK_FAILED)\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("error 6: parity check failed\n");\r
+ ANALYZE_PRINTF ("error 6: parity check failed\n");\r
#endif // ANALYZE\r
- irmp_ir_detected = FALSE;\r
- }\r
+ irmp_ir_detected = FALSE;\r
+ }\r
\r
- if ((irmp_tmp_address & 0x03) == 0x02)\r
- {\r
+ if ((irmp_tmp_address & 0x03) == 0x02)\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("code skipped: ORTEK end of transmission frame (key release)\n");\r
+ ANALYZE_PRINTF ("code skipped: ORTEK end of transmission frame (key release)\n");\r
#endif // ANALYZE\r
- irmp_ir_detected = FALSE;\r
- }\r
- irmp_tmp_address >>= 2;\r
- }\r
+ irmp_ir_detected = FALSE;\r
+ }\r
+ irmp_tmp_address >>= 2;\r
+ }\r
#endif // IRMP_SUPPORT_ORTEK_PROTOCOL == 1\r
\r
#if IRMP_SUPPORT_RC6_PROTOCOL == 1\r
- if (irmp_param.protocol == IRMP_RC6_PROTOCOL && irmp_param.complete_len == RC6_COMPLETE_DATA_LEN_LONG) // RC6 mode = 6?\r
- {\r
- irmp_protocol = IRMP_RC6A_PROTOCOL;\r
- }\r
- else\r
+ if (irmp_param.protocol == IRMP_RC6_PROTOCOL && irmp_param.complete_len == RC6_COMPLETE_DATA_LEN_LONG) // RC6 mode = 6?\r
+ {\r
+ irmp_protocol = IRMP_RC6A_PROTOCOL;\r
+ }\r
+ else\r
#endif // IRMP_SUPPORT_RC6_PROTOCOL == 1\r
- {\r
- irmp_protocol = irmp_param.protocol;\r
- }\r
+ {\r
+ irmp_protocol = irmp_param.protocol;\r
+ }\r
\r
#if IRMP_SUPPORT_FDC_PROTOCOL == 1\r
- if (irmp_param.protocol == IRMP_FDC_PROTOCOL)\r
- {\r
- if (irmp_tmp_command & 0x000F) // released key?\r
- {\r
- irmp_tmp_command = (irmp_tmp_command >> 4) | 0x80; // yes, set bit 7\r
- }\r
- else\r
- {\r
- irmp_tmp_command >>= 4; // no, it's a pressed key\r
- }\r
- irmp_tmp_command |= (irmp_tmp_address << 2) & 0x0F00; // 000000CCCCAAAAAA -> 0000CCCC00000000\r
- irmp_tmp_address &= 0x003F;\r
- }\r
+ if (irmp_param.protocol == IRMP_FDC_PROTOCOL)\r
+ {\r
+ if (irmp_tmp_command & 0x000F) // released key?\r
+ {\r
+ irmp_tmp_command = (irmp_tmp_command >> 4) | 0x80; // yes, set bit 7\r
+ }\r
+ else\r
+ {\r
+ irmp_tmp_command >>= 4; // no, it's a pressed key\r
+ }\r
+ irmp_tmp_command |= (irmp_tmp_address << 2) & 0x0F00; // 000000CCCCAAAAAA -> 0000CCCC00000000\r
+ irmp_tmp_address &= 0x003F;\r
+ }\r
#endif\r
\r
- irmp_address = irmp_tmp_address; // store address\r
+ irmp_address = irmp_tmp_address; // store address\r
#if IRMP_SUPPORT_NEC_PROTOCOL == 1\r
- if (irmp_param.protocol == IRMP_NEC_PROTOCOL)\r
- {\r
- last_irmp_address = irmp_tmp_address; // store as last address, too\r
- }\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
- if (irmp_param.protocol == IRMP_RC5_PROTOCOL)\r
- {\r
- irmp_tmp_command |= rc5_cmd_bit6; // store bit 6\r
- }\r
+ if (irmp_param.protocol == IRMP_RC5_PROTOCOL)\r
+ {\r
+ irmp_tmp_command |= rc5_cmd_bit6; // store bit 6\r
+ }\r
#endif\r
#if IRMP_SUPPORT_S100_PROTOCOL == 1\r
- if (irmp_param.protocol == IRMP_S100_PROTOCOL)\r
- {\r
- irmp_tmp_command |= rc5_cmd_bit6; // store bit 6\r
- }\r
+ if (irmp_param.protocol == IRMP_S100_PROTOCOL)\r
+ {\r
+ irmp_tmp_command |= rc5_cmd_bit6; // store bit 6\r
+ }\r
#endif\r
- irmp_command = irmp_tmp_command; // store command\r
+ irmp_command = irmp_tmp_command; // store command\r
\r
#if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1\r
- irmp_id = irmp_tmp_id;\r
+ irmp_id = irmp_tmp_id;\r
#endif\r
- }\r
- }\r
+ }\r
+ }\r
\r
- if (irmp_ir_detected)\r
- {\r
- if (last_irmp_command == irmp_tmp_command &&\r
- last_irmp_address == irmp_tmp_address &&\r
- key_repetition_len < IRMP_KEY_REPETITION_LEN)\r
- {\r
- irmp_flags |= IRMP_FLAG_REPETITION;\r
- }\r
+ if (irmp_ir_detected)\r
+ {\r
+ if (last_irmp_command == irmp_tmp_command &&\r
+ last_irmp_address == irmp_tmp_address &&\r
+ key_repetition_len < IRMP_KEY_REPETITION_LEN)\r
+ {\r
+ irmp_flags |= IRMP_FLAG_REPETITION;\r
+ }\r
\r
- last_irmp_address = irmp_tmp_address; // store as last address, too\r
- last_irmp_command = irmp_tmp_command; // store as last command, too\r
+ last_irmp_address = irmp_tmp_address; // store as last address, too\r
+ last_irmp_command = irmp_tmp_command; // store as last command, too\r
\r
- key_repetition_len = 0;\r
- }\r
- else\r
- {\r
+ key_repetition_len = 0;\r
+ }\r
+ else\r
+ {\r
#ifdef ANALYZE\r
- ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');\r
+ ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');\r
#endif // ANALYZE\r
- }\r
+ }\r
\r
- irmp_start_bit_detected = 0; // and wait for next start bit\r
- irmp_tmp_command = 0;\r
- irmp_pulse_time = 0;\r
- irmp_pause_time = 0;\r
+ irmp_start_bit_detected = 0; // and wait for next start bit\r
+ irmp_tmp_command = 0;\r
+ irmp_pulse_time = 0;\r
+ irmp_pause_time = 0;\r
\r
#if IRMP_SUPPORT_JVC_PROTOCOL == 1\r
- if (irmp_protocol == IRMP_JVC_PROTOCOL) // the stop bit of JVC frame is also start bit of next frame\r
- { // set pulse time here!\r
- irmp_pulse_time = ((uint_fast8_t)(F_INTERRUPTS * JVC_START_BIT_PULSE_TIME));\r
- }\r
+ if (irmp_protocol == IRMP_JVC_PROTOCOL) // the stop bit of JVC frame is also start bit of next frame\r
+ { // set pulse time here!\r
+ irmp_pulse_time = ((uint_fast8_t)(F_INTERRUPTS * JVC_START_BIT_PULSE_TIME));\r
+ }\r
#endif // IRMP_SUPPORT_JVC_PROTOCOL == 1\r
- }\r
- }\r
+ }\r
+ }\r
}\r
\r
#if defined(STELLARIS_ARM_CORTEX_M4)\r
\r
for (i = 0; i < 256; i++)\r
{\r
- if (buf[i] > max_value)\r
- {\r
- max_value = buf[i];\r
- }\r
+ if (buf[i] > max_value)\r
+ {\r
+ max_value = buf[i];\r
+ }\r
}\r
\r
for (i = 1; i < 200; i++)\r
{\r
- if (buf[i] > 0)\r
- {\r
- printf ("%3d ", i);\r
- value = (buf[i] * 60) / max_value;\r
-\r
- for (j = 0; j < value; j++)\r
- {\r
- putchar ('o');\r
- }\r
- printf (" %d\n", buf[i]);\r
-\r
- sum += i * buf[i];\r
- counter += buf[i];\r
- }\r
- else\r
- {\r
- max = i - 1;\r
-\r
- if (counter > 0)\r
- {\r
- average = (float) sum / (float) counter;\r
-\r
- if (is_pulse)\r
- {\r
- printf ("pulse ");\r
- }\r
- else\r
- {\r
- printf ("pause ");\r
- }\r
-\r
- printf ("avg: %4.1f=%6.1f us, ", average, (1000000. * average) / (float) F_INTERRUPTS);\r
- printf ("min: %2d=%6.1f us, ", min, (1000000. * min) / (float) F_INTERRUPTS);\r
- printf ("max: %2d=%6.1f us, ", max, (1000000. * max) / (float) F_INTERRUPTS);\r
-\r
- tolerance = (max - average);\r
-\r
- if (average - min > tolerance)\r
- {\r
- tolerance = average - min;\r
- }\r
-\r
- tolerance = tolerance * 100 / average;\r
- printf ("tol: %4.1f%%\n", tolerance);\r
- }\r
-\r
- counter = 0;\r
- sum = 0;\r
- min = i + 1;\r
- }\r
+ if (buf[i] > 0)\r
+ {\r
+ printf ("%3d ", i);\r
+ value = (buf[i] * 60) / max_value;\r
+\r
+ for (j = 0; j < value; j++)\r
+ {\r
+ putchar ('o');\r
+ }\r
+ printf (" %d\n", buf[i]);\r
+\r
+ sum += i * buf[i];\r
+ counter += buf[i];\r
+ }\r
+ else\r
+ {\r
+ max = i - 1;\r
+\r
+ if (counter > 0)\r
+ {\r
+ average = (float) sum / (float) counter;\r
+\r
+ if (is_pulse)\r
+ {\r
+ printf ("pulse ");\r
+ }\r
+ else\r
+ {\r
+ printf ("pause ");\r
+ }\r
+\r
+ printf ("avg: %4.1f=%6.1f us, ", average, (1000000. * average) / (float) F_INTERRUPTS);\r
+ printf ("min: %2d=%6.1f us, ", min, (1000000. * min) / (float) F_INTERRUPTS);\r
+ printf ("max: %2d=%6.1f us, ", max, (1000000. * max) / (float) F_INTERRUPTS);\r
+\r
+ tolerance = (max - average);\r
+\r
+ if (average - min > tolerance)\r
+ {\r
+ tolerance = average - min;\r
+ }\r
+\r
+ tolerance = tolerance * 100 / average;\r
+ printf ("tol: %4.1f%%\n", tolerance);\r
+ }\r
+\r
+ counter = 0;\r
+ sum = 0;\r
+ min = i + 1;\r
+ }\r
}\r
}\r
\r
static uint8_t key_table[128] =\r
{\r
// 0 1 2 3 4 5 6 7 8 9 A B C D E F\r
- 0, '^', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'ß', '´', 0, '\b',\r
+ 0, '^', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'ß', '´', 0, '\b',\r
'\t','q', 'w', 'e', 'r', 't', 'z', 'u', 'i', 'o', 'p', 'ü', '+', 0, 0, 'a',\r
's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'ö', 'ä', '#', '\r', 0, '<', 'y', 'x',\r
'c', 'v', 'b', 'n', 'm', ',', '.', '-', 0, 0, 0, 0, 0, ' ', 0, 0,\r
\r
- 0, '°', '!', '"', '§', '$', '%', '&', '/', '(', ')', '=', '?', '`', 0, '\b',\r
+ 0, '°', '!', '"', '§', '$', '%', '&', '/', '(', ')', '=', '?', '`', 0, '\b',\r
'\t','Q', 'W', 'E', 'R', 'T', 'Z', 'U', 'I', 'O', 'P', 'Ü', '*', 0, 0, 'A',\r
'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Ö', 'Ä', '\'','\r', 0, '>', 'Y', 'X',\r
'C', 'V', 'B', 'N', 'M', ';', ':', '_', 0, 0, 0, 0, 0, ' ', 0, 0\r
\r
switch (cmd)\r
{\r
- case 0x002C: state |= STATE_LEFT_SHIFT; break; // pressed left shift\r
- case 0x00AC: state &= ~STATE_LEFT_SHIFT; break; // released left shift\r
- case 0x0039: state |= STATE_RIGHT_SHIFT; break; // pressed right shift\r
- case 0x00B9: state &= ~STATE_RIGHT_SHIFT; break; // released right shift\r
- case 0x003A: state |= STATE_LEFT_CTRL; break; // pressed left ctrl\r
- case 0x00BA: state &= ~STATE_LEFT_CTRL; break; // released left ctrl\r
- case 0x003C: state |= STATE_LEFT_ALT; break; // pressed left alt\r
- case 0x00BC: state &= ~STATE_LEFT_ALT; break; // released left alt\r
- case 0x003E: state |= STATE_RIGHT_ALT; break; // pressed left alt\r
- case 0x00BE: state &= ~STATE_RIGHT_ALT; break; // released left alt\r
-\r
- case 0x006e: key = KEY_ESCAPE; break;\r
- case 0x004b: key = KEY_INSERT; break;\r
- case 0x004c: key = KEY_DELETE; break;\r
- case 0x004f: key = KEY_LEFT; break;\r
- case 0x0050: key = KEY_HOME; break;\r
- case 0x0051: key = KEY_END; break;\r
- case 0x0053: key = KEY_UP; break;\r
- case 0x0054: key = KEY_DOWN; break;\r
- case 0x0055: key = KEY_PAGE_UP; break;\r
- case 0x0056: key = KEY_PAGE_DOWN; break;\r
- case 0x0059: key = KEY_RIGHT; break;\r
- case 0x0400: key = KEY_MOUSE_1; break;\r
- case 0x0800: key = KEY_MOUSE_2; break;\r
-\r
- default:\r
- {\r
- if (!(cmd & 0x80)) // pressed key\r
- {\r
- if (cmd >= 0x70 && cmd <= 0x7F) // function keys\r
- {\r
- key = cmd + 0x10; // 7x -> 8x\r
- }\r
- else if (cmd < 64) // key listed in key_table\r
- {\r
- if (state & (STATE_LEFT_ALT | STATE_RIGHT_ALT))\r
- {\r
- switch (cmd)\r
- {\r
- case 0x0003: key = '²'; break;\r
- case 0x0008: key = '{'; break;\r
- case 0x0009: key = '['; break;\r
- case 0x000A: key = ']'; break;\r
- case 0x000B: key = '}'; break;\r
- case 0x000C: key = '\\'; break;\r
- case 0x001C: key = '~'; break;\r
- case 0x002D: key = '|'; break;\r
- case 0x0034: key = 0xB5; break; // Mu\r
- }\r
- }\r
- else if (state & (STATE_LEFT_CTRL))\r
- {\r
- if (key_table[cmd] >= 'a' && key_table[cmd] <= 'z')\r
- {\r
- key = key_table[cmd] - 'a' + 1;\r
- }\r
- else\r
- {\r
- key = key_table[cmd];\r
- }\r
- }\r
- else\r
- {\r
- int idx = cmd + ((state & (STATE_LEFT_SHIFT | STATE_RIGHT_SHIFT)) ? 64 : 0);\r
-\r
- if (key_table[idx])\r
- {\r
- key = key_table[idx];\r
- }\r
- }\r
- }\r
- }\r
- break;\r
- }\r
+ case 0x002C: state |= STATE_LEFT_SHIFT; break; // pressed left shift\r
+ case 0x00AC: state &= ~STATE_LEFT_SHIFT; break; // released left shift\r
+ case 0x0039: state |= STATE_RIGHT_SHIFT; break; // pressed right shift\r
+ case 0x00B9: state &= ~STATE_RIGHT_SHIFT; break; // released right shift\r
+ case 0x003A: state |= STATE_LEFT_CTRL; break; // pressed left ctrl\r
+ case 0x00BA: state &= ~STATE_LEFT_CTRL; break; // released left ctrl\r
+ case 0x003C: state |= STATE_LEFT_ALT; break; // pressed left alt\r
+ case 0x00BC: state &= ~STATE_LEFT_ALT; break; // released left alt\r
+ case 0x003E: state |= STATE_RIGHT_ALT; break; // pressed left alt\r
+ case 0x00BE: state &= ~STATE_RIGHT_ALT; break; // released left alt\r
+\r
+ case 0x006e: key = KEY_ESCAPE; break;\r
+ case 0x004b: key = KEY_INSERT; break;\r
+ case 0x004c: key = KEY_DELETE; break;\r
+ case 0x004f: key = KEY_LEFT; break;\r
+ case 0x0050: key = KEY_HOME; break;\r
+ case 0x0051: key = KEY_END; break;\r
+ case 0x0053: key = KEY_UP; break;\r
+ case 0x0054: key = KEY_DOWN; break;\r
+ case 0x0055: key = KEY_PAGE_UP; break;\r
+ case 0x0056: key = KEY_PAGE_DOWN; break;\r
+ case 0x0059: key = KEY_RIGHT; break;\r
+ case 0x0400: key = KEY_MOUSE_1; break;\r
+ case 0x0800: key = KEY_MOUSE_2; break;\r
+\r
+ default:\r
+ {\r
+ if (!(cmd & 0x80)) // pressed key\r
+ {\r
+ if (cmd >= 0x70 && cmd <= 0x7F) // function keys\r
+ {\r
+ key = cmd + 0x10; // 7x -> 8x\r
+ }\r
+ else if (cmd < 64) // key listed in key_table\r
+ {\r
+ if (state & (STATE_LEFT_ALT | STATE_RIGHT_ALT))\r
+ {\r
+ switch (cmd)\r
+ {\r
+ case 0x0003: key = '²'; break;\r
+ case 0x0008: key = '{'; break;\r
+ case 0x0009: key = '['; break;\r
+ case 0x000A: key = ']'; break;\r
+ case 0x000B: key = '}'; break;\r
+ case 0x000C: key = '\\'; break;\r
+ case 0x001C: key = '~'; break;\r
+ case 0x002D: key = '|'; break;\r
+ case 0x0034: key = 0xB5; break; // Mu\r
+ }\r
+ }\r
+ else if (state & (STATE_LEFT_CTRL))\r
+ {\r
+ if (key_table[cmd] >= 'a' && key_table[cmd] <= 'z')\r
+ {\r
+ key = key_table[cmd] - 'a' + 1;\r
+ }\r
+ else\r
+ {\r
+ key = key_table[cmd];\r
+ }\r
+ }\r
+ else\r
+ {\r
+ int idx = cmd + ((state & (STATE_LEFT_SHIFT | STATE_RIGHT_SHIFT)) ? 64 : 0);\r
+\r
+ if (key_table[idx])\r
+ {\r
+ key = key_table[idx];\r
+ }\r
+ }\r
+ }\r
+ }\r
+ break;\r
+ }\r
}\r
\r
return (key);\r
{\r
if (! analyze && ! list)\r
{\r
- (void) irmp_ISR ();\r
-\r
- if (irmp_get_data (&irmp_data))\r
- {\r
- uint_fast8_t key;\r
-\r
- ANALYZE_ONLY_NORMAL_PUTCHAR (' ');\r
-\r
- if (verbose)\r
- {\r
- printf ("%8.3fms ", (double) (time_counter * 1000) / F_INTERRUPTS);\r
- }\r
-\r
- if (irmp_data.protocol == IRMP_ACP24_PROTOCOL)\r
- {\r
- uint16_t temp = (irmp_data.command & 0x000F) + 15;\r
-\r
- printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, temp=%d",\r
- irmp_data.protocol, irmp_protocol_names[irmp_data.protocol], irmp_data.address, irmp_data.command, irmp_data.flags, temp);\r
- }\r
- else if (irmp_data.protocol == IRMP_FDC_PROTOCOL && (key = get_fdc_key (irmp_data.command)) != 0)\r
- {\r
- if ((key >= 0x20 && key < 0x7F) || key >= 0xA0)\r
- {\r
- printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x, key='%c'",\r
- irmp_data.protocol, irmp_protocol_names[irmp_data.protocol], irmp_data.address, irmp_data.command, irmp_data.flags, key, key);\r
- }\r
- else if (key == '\r' || key == '\t' || key == KEY_ESCAPE || (key >= 0x80 && key <= 0x9F)) // function keys\r
- {\r
- char * p = (char *) NULL;\r
-\r
- switch (key)\r
- {\r
- case '\t' : p = "TAB"; break;\r
- case '\r' : p = "CR"; break;\r
- case KEY_ESCAPE : p = "ESCAPE"; break;\r
- case KEY_MENUE : p = "MENUE"; break;\r
- case KEY_BACK : p = "BACK"; break;\r
- case KEY_FORWARD : p = "FORWARD"; break;\r
- case KEY_ADDRESS : p = "ADDRESS"; break;\r
- case KEY_WINDOW : p = "WINDOW"; break;\r
- case KEY_1ST_PAGE : p = "1ST_PAGE"; break;\r
- case KEY_STOP : p = "STOP"; break;\r
- case KEY_MAIL : p = "MAIL"; break;\r
- case KEY_FAVORITES : p = "FAVORITES"; break;\r
- case KEY_NEW_PAGE : p = "NEW_PAGE"; break;\r
- case KEY_SETUP : p = "SETUP"; break;\r
- case KEY_FONT : p = "FONT"; break;\r
- case KEY_PRINT : p = "PRINT"; break;\r
- case KEY_ON_OFF : p = "ON_OFF"; break;\r
-\r
- case KEY_INSERT : p = "INSERT"; break;\r
- case KEY_DELETE : p = "DELETE"; break;\r
- case KEY_LEFT : p = "LEFT"; break;\r
- case KEY_HOME : p = "HOME"; break;\r
- case KEY_END : p = "END"; break;\r
- case KEY_UP : p = "UP"; break;\r
- case KEY_DOWN : p = "DOWN"; break;\r
- case KEY_PAGE_UP : p = "PAGE_UP"; break;\r
- case KEY_PAGE_DOWN : p = "PAGE_DOWN"; break;\r
- case KEY_RIGHT : p = "RIGHT"; break;\r
- case KEY_MOUSE_1 : p = "KEY_MOUSE_1"; break;\r
- case KEY_MOUSE_2 : p = "KEY_MOUSE_2"; break;\r
- default : p = "<UNKNWON>"; break;\r
- }\r
-\r
- printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x, key=%s",\r
- irmp_data.protocol, irmp_protocol_names[irmp_data.protocol], irmp_data.address, irmp_data.command, irmp_data.flags, key, p);\r
- }\r
- else\r
- {\r
- printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x",\r
- irmp_data.protocol, irmp_protocol_names[irmp_data.protocol], irmp_data.address, irmp_data.command, irmp_data.flags, key);\r
- }\r
- }\r
- else\r
- {\r
- printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x",\r
- irmp_data.protocol, irmp_protocol_names[irmp_data.protocol], irmp_data.address, irmp_data.command, irmp_data.flags);\r
- }\r
-\r
- if (do_check_expected_values)\r
- {\r
- if (irmp_data.protocol != expected_protocol ||\r
- irmp_data.address != expected_address ||\r
- irmp_data.command != expected_command)\r
- {\r
- printf ("\nerror 7: expected values differ: p=%2d (%s), a=0x%04x, c=0x%04x\n",\r
- expected_protocol, irmp_protocol_names[expected_protocol], expected_address, expected_command);\r
- }\r
- else\r
- {\r
- printf (" checked!\n");\r
- }\r
- do_check_expected_values = FALSE; // only check 1st frame in a line!\r
- }\r
- else\r
- {\r
- putchar ('\n');\r
- }\r
- }\r
+ (void) irmp_ISR ();\r
+\r
+ if (irmp_get_data (&irmp_data))\r
+ {\r
+ uint_fast8_t key;\r
+\r
+ ANALYZE_ONLY_NORMAL_PUTCHAR (' ');\r
+\r
+ if (verbose)\r
+ {\r
+ printf ("%8.3fms ", (double) (time_counter * 1000) / F_INTERRUPTS);\r
+ }\r
+\r
+ if (irmp_data.protocol == IRMP_ACP24_PROTOCOL)\r
+ {\r
+ uint16_t temp = (irmp_data.command & 0x000F) + 15;\r
+\r
+ printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, temp=%d",\r
+ irmp_data.protocol, irmp_protocol_names[irmp_data.protocol], irmp_data.address, irmp_data.command, irmp_data.flags, temp);\r
+ }\r
+ else if (irmp_data.protocol == IRMP_FDC_PROTOCOL && (key = get_fdc_key (irmp_data.command)) != 0)\r
+ {\r
+ if ((key >= 0x20 && key < 0x7F) || key >= 0xA0)\r
+ {\r
+ printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x, key='%c'",\r
+ irmp_data.protocol, irmp_protocol_names[irmp_data.protocol], irmp_data.address, irmp_data.command, irmp_data.flags, key, key);\r
+ }\r
+ else if (key == '\r' || key == '\t' || key == KEY_ESCAPE || (key >= 0x80 && key <= 0x9F)) // function keys\r
+ {\r
+ char * p = (char *) NULL;\r
+\r
+ switch (key)\r
+ {\r
+ case '\t' : p = "TAB"; break;\r
+ case '\r' : p = "CR"; break;\r
+ case KEY_ESCAPE : p = "ESCAPE"; break;\r
+ case KEY_MENUE : p = "MENUE"; break;\r
+ case KEY_BACK : p = "BACK"; break;\r
+ case KEY_FORWARD : p = "FORWARD"; break;\r
+ case KEY_ADDRESS : p = "ADDRESS"; break;\r
+ case KEY_WINDOW : p = "WINDOW"; break;\r
+ case KEY_1ST_PAGE : p = "1ST_PAGE"; break;\r
+ case KEY_STOP : p = "STOP"; break;\r
+ case KEY_MAIL : p = "MAIL"; break;\r
+ case KEY_FAVORITES : p = "FAVORITES"; break;\r
+ case KEY_NEW_PAGE : p = "NEW_PAGE"; break;\r
+ case KEY_SETUP : p = "SETUP"; break;\r
+ case KEY_FONT : p = "FONT"; break;\r
+ case KEY_PRINT : p = "PRINT"; break;\r
+ case KEY_ON_OFF : p = "ON_OFF"; break;\r
+\r
+ case KEY_INSERT : p = "INSERT"; break;\r
+ case KEY_DELETE : p = "DELETE"; break;\r
+ case KEY_LEFT : p = "LEFT"; break;\r
+ case KEY_HOME : p = "HOME"; break;\r
+ case KEY_END : p = "END"; break;\r
+ case KEY_UP : p = "UP"; break;\r
+ case KEY_DOWN : p = "DOWN"; break;\r
+ case KEY_PAGE_UP : p = "PAGE_UP"; break;\r
+ case KEY_PAGE_DOWN : p = "PAGE_DOWN"; break;\r
+ case KEY_RIGHT : p = "RIGHT"; break;\r
+ case KEY_MOUSE_1 : p = "KEY_MOUSE_1"; break;\r
+ case KEY_MOUSE_2 : p = "KEY_MOUSE_2"; break;\r
+ default : p = "<UNKNWON>"; break;\r
+ }\r
+\r
+ printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x, key=%s",\r
+ irmp_data.protocol, irmp_protocol_names[irmp_data.protocol], irmp_data.address, irmp_data.command, irmp_data.flags, key, p);\r
+ }\r
+ else\r
+ {\r
+ printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x",\r
+ irmp_data.protocol, irmp_protocol_names[irmp_data.protocol], irmp_data.address, irmp_data.command, irmp_data.flags, key);\r
+ }\r
+ }\r
+ else\r
+ {\r
+ printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x",\r
+ irmp_data.protocol, irmp_protocol_names[irmp_data.protocol], irmp_data.address, irmp_data.command, irmp_data.flags);\r
+ }\r
+\r
+ if (do_check_expected_values)\r
+ {\r
+ if (irmp_data.protocol != expected_protocol ||\r
+ irmp_data.address != expected_address ||\r
+ irmp_data.command != expected_command)\r
+ {\r
+ printf ("\nerror 7: expected values differ: p=%2d (%s), a=0x%04x, c=0x%04x\n",\r
+ expected_protocol, irmp_protocol_names[expected_protocol], expected_address, expected_command);\r
+ }\r
+ else\r
+ {\r
+ printf (" checked!\n");\r
+ }\r
+ do_check_expected_values = FALSE; // only check 1st frame in a line!\r
+ }\r
+ else\r
+ {\r
+ putchar ('\n');\r
+ }\r
+ }\r
}\r
}\r
\r
\r
if (argc == 2)\r
{\r
- if (! strcmp (argv[1], "-v"))\r
- {\r
- verbose = TRUE;\r
- }\r
- else if (! strcmp (argv[1], "-l"))\r
- {\r
- list = TRUE;\r
- }\r
- else if (! strcmp (argv[1], "-a"))\r
- {\r
- analyze = TRUE;\r
- }\r
- else if (! strcmp (argv[1], "-s"))\r
- {\r
- silent = TRUE;\r
- }\r
- else if (! strcmp (argv[1], "-r"))\r
- {\r
- radio = TRUE;\r
- }\r
+ if (! strcmp (argv[1], "-v"))\r
+ {\r
+ verbose = TRUE;\r
+ }\r
+ else if (! strcmp (argv[1], "-l"))\r
+ {\r
+ list = TRUE;\r
+ }\r
+ else if (! strcmp (argv[1], "-a"))\r
+ {\r
+ analyze = TRUE;\r
+ }\r
+ else if (! strcmp (argv[1], "-s"))\r
+ {\r
+ silent = TRUE;\r
+ }\r
+ else if (! strcmp (argv[1], "-r"))\r
+ {\r
+ radio = TRUE;\r
+ }\r
}\r
\r
for (i = 0; i < 256; i++)\r
{\r
- start_pulses[i] = 0;\r
- start_pauses[i] = 0;\r
- pulses[i] = 0;\r
- pauses[i] = 0;\r
+ start_pulses[i] = 0;\r
+ start_pauses[i] = 0;\r
+ pulses[i] = 0;\r
+ pauses[i] = 0;\r
}\r
\r
IRMP_PIN = 0xFF;\r
\r
while ((ch = getchar ()) != EOF)\r
{\r
- if (ch == '_' || ch == '0')\r
- {\r
- if (last_ch != ch)\r
- {\r
- if (pause > 0)\r
- {\r
- if (list)\r
- {\r
- printf ("pause: %d\n", pause);\r
- }\r
-\r
- if (analyze)\r
- {\r
- if (first_pause)\r
- {\r
- if (pause < 256)\r
- {\r
- start_pauses[pause]++;\r
- }\r
- first_pause = FALSE;\r
- }\r
- else\r
- {\r
- if (pause < 256)\r
- {\r
- pauses[pause]++;\r
- }\r
- }\r
- }\r
- }\r
- pause = 0;\r
- }\r
- pulse++;\r
- IRMP_PIN = 0x00;\r
- }\r
- else if (ch == 0xaf || ch == '-' || ch == '1')\r
- {\r
- if (last_ch != ch)\r
- {\r
- if (list)\r
- {\r
- printf ("pulse: %d ", pulse);\r
- }\r
-\r
- if (analyze)\r
- {\r
- if (first_pulse)\r
- {\r
- if (pulse < 256)\r
- {\r
- start_pulses[pulse]++;\r
- }\r
- first_pulse = FALSE;\r
- }\r
- else\r
- {\r
- if (pulse < 256)\r
- {\r
- pulses[pulse]++;\r
- }\r
- }\r
- }\r
- pulse = 0;\r
- }\r
-\r
- pause++;\r
- IRMP_PIN = 0xff;\r
- }\r
- else if (ch == '\n')\r
- {\r
- IRMP_PIN = 0xff;\r
- time_counter = 0;\r
-\r
- if (list && pause > 0)\r
- {\r
- printf ("pause: %d\n", pause);\r
- }\r
- pause = 0;\r
-\r
- if (! analyze)\r
- {\r
- for (i = 0; i < (int) ((10000.0 * F_INTERRUPTS) / 10000); i++) // newline: long pause of 10000 msec\r
- {\r
- next_tick ();\r
- }\r
- }\r
- first_pulse = TRUE;\r
- first_pause = TRUE;\r
- }\r
- else if (ch == '#')\r
- {\r
- time_counter = 0;\r
-\r
- if (analyze)\r
- {\r
- while ((ch = getchar()) != '\n' && ch != EOF)\r
- {\r
- ;\r
- }\r
- }\r
- else\r
- {\r
- char buf[1024];\r
- char * p;\r
- int idx = -1;\r
-\r
- puts ("----------------------------------------------------------------------");\r
- putchar (ch);\r
-\r
-\r
- while ((ch = getchar()) != '\n' && ch != EOF)\r
- {\r
- if (ch != '\r') // ignore CR in DOS/Windows files\r
- {\r
- if (ch == '[' && idx == -1)\r
- {\r
- idx = 0;\r
- }\r
- else if (idx >= 0)\r
- {\r
- if (ch == ']')\r
- {\r
- do_check_expected_values = FALSE;\r
- buf[idx] = '\0';\r
- idx = -1;\r
-\r
- expected_protocol = atoi (buf);\r
-\r
- if (expected_protocol > 0)\r
- {\r
- p = buf;\r
- while (*p)\r
- {\r
- if (*p == 'x')\r
- {\r
- p++;\r
-\r
- if (sscanf (p, "%x", &expected_address) == 1)\r
- {\r
- do_check_expected_values = TRUE;\r
- }\r
- break;\r
- }\r
- p++;\r
- }\r
-\r
- if (do_check_expected_values)\r
- {\r
- do_check_expected_values = FALSE;\r
-\r
- while (*p)\r
- {\r
- if (*p == 'x')\r
- {\r
- p++;\r
-\r
- if (sscanf (p, "%x", &expected_command) == 1)\r
- {\r
- do_check_expected_values = TRUE;\r
- }\r
- break;\r
- }\r
- p++;\r
- }\r
-\r
- if (do_check_expected_values)\r
- {\r
- // printf ("!%2d %04x %04x!\n", expected_protocol, expected_address, expected_command);\r
- }\r
- }\r
- }\r
- }\r
- else if (idx < 1024 - 2)\r
- {\r
- buf[idx++] = ch;\r
- }\r
- }\r
- putchar (ch);\r
- }\r
- }\r
- putchar ('\n');\r
- }\r
-\r
- }\r
-\r
- last_ch = ch;\r
-\r
- next_tick ();\r
+ if (ch == '_' || ch == '0')\r
+ {\r
+ if (last_ch != ch)\r
+ {\r
+ if (pause > 0)\r
+ {\r
+ if (list)\r
+ {\r
+ printf ("pause: %d\n", pause);\r
+ }\r
+\r
+ if (analyze)\r
+ {\r
+ if (first_pause)\r
+ {\r
+ if (pause < 256)\r
+ {\r
+ start_pauses[pause]++;\r
+ }\r
+ first_pause = FALSE;\r
+ }\r
+ else\r
+ {\r
+ if (pause < 256)\r
+ {\r
+ pauses[pause]++;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ pause = 0;\r
+ }\r
+ pulse++;\r
+ IRMP_PIN = 0x00;\r
+ }\r
+ else if (ch == 0xaf || ch == '-' || ch == '1')\r
+ {\r
+ if (last_ch != ch)\r
+ {\r
+ if (list)\r
+ {\r
+ printf ("pulse: %d ", pulse);\r
+ }\r
+\r
+ if (analyze)\r
+ {\r
+ if (first_pulse)\r
+ {\r
+ if (pulse < 256)\r
+ {\r
+ start_pulses[pulse]++;\r
+ }\r
+ first_pulse = FALSE;\r
+ }\r
+ else\r
+ {\r
+ if (pulse < 256)\r
+ {\r
+ pulses[pulse]++;\r
+ }\r
+ }\r
+ }\r
+ pulse = 0;\r
+ }\r
+\r
+ pause++;\r
+ IRMP_PIN = 0xff;\r
+ }\r
+ else if (ch == '\n')\r
+ {\r
+ IRMP_PIN = 0xff;\r
+ time_counter = 0;\r
+\r
+ if (list && pause > 0)\r
+ {\r
+ printf ("pause: %d\n", pause);\r
+ }\r
+ pause = 0;\r
+\r
+ if (! analyze)\r
+ {\r
+ for (i = 0; i < (int) ((10000.0 * F_INTERRUPTS) / 10000); i++) // newline: long pause of 10000 msec\r
+ {\r
+ next_tick ();\r
+ }\r
+ }\r
+ first_pulse = TRUE;\r
+ first_pause = TRUE;\r
+ }\r
+ else if (ch == '#')\r
+ {\r
+ time_counter = 0;\r
+\r
+ if (analyze)\r
+ {\r
+ while ((ch = getchar()) != '\n' && ch != EOF)\r
+ {\r
+ ;\r
+ }\r
+ }\r
+ else\r
+ {\r
+ char buf[1024];\r
+ char * p;\r
+ int idx = -1;\r
+\r
+ puts ("----------------------------------------------------------------------");\r
+ putchar (ch);\r
+\r
+\r
+ while ((ch = getchar()) != '\n' && ch != EOF)\r
+ {\r
+ if (ch != '\r') // ignore CR in DOS/Windows files\r
+ {\r
+ if (ch == '[' && idx == -1)\r
+ {\r
+ idx = 0;\r
+ }\r
+ else if (idx >= 0)\r
+ {\r
+ if (ch == ']')\r
+ {\r
+ do_check_expected_values = FALSE;\r
+ buf[idx] = '\0';\r
+ idx = -1;\r
+\r
+ expected_protocol = atoi (buf);\r
+\r
+ if (expected_protocol > 0)\r
+ {\r
+ p = buf;\r
+ while (*p)\r
+ {\r
+ if (*p == 'x')\r
+ {\r
+ p++;\r
+\r
+ if (sscanf (p, "%x", &expected_address) == 1)\r
+ {\r
+ do_check_expected_values = TRUE;\r
+ }\r
+ break;\r
+ }\r
+ p++;\r
+ }\r
+\r
+ if (do_check_expected_values)\r
+ {\r
+ do_check_expected_values = FALSE;\r
+\r
+ while (*p)\r
+ {\r
+ if (*p == 'x')\r
+ {\r
+ p++;\r
+\r
+ if (sscanf (p, "%x", &expected_command) == 1)\r
+ {\r
+ do_check_expected_values = TRUE;\r
+ }\r
+ break;\r
+ }\r
+ p++;\r
+ }\r
+\r
+ if (do_check_expected_values)\r
+ {\r
+ // printf ("!%2d %04x %04x!\n", expected_protocol, expected_address, expected_command);\r
+ }\r
+ }\r
+ }\r
+ }\r
+ else if (idx < 1024 - 2)\r
+ {\r
+ buf[idx++] = ch;\r
+ }\r
+ }\r
+ putchar (ch);\r
+ }\r
+ }\r
+ putchar ('\n');\r
+ }\r
+\r
+ }\r
+\r
+ last_ch = ch;\r
+\r
+ next_tick ();\r
}\r
\r
if (analyze)\r
{\r
- print_spectrum ("START PULSES", start_pulses, TRUE);\r
- print_spectrum ("START PAUSES", start_pauses, FALSE);\r
- print_spectrum ("PULSES", pulses, TRUE);\r
- print_spectrum ("PAUSES", pauses, FALSE);\r
- puts ("-----------------------------------------------------------------------------");\r
+ print_spectrum ("START PULSES", start_pulses, TRUE);\r
+ print_spectrum ("START PAUSES", start_pauses, FALSE);\r
+ print_spectrum ("PULSES", pulses, TRUE);\r
+ print_spectrum ("PAUSES", pauses, FALSE);\r
+ puts ("-----------------------------------------------------------------------------");\r
}\r
return 0;\r
}\r
* ATmega164, ATmega324, ATmega644, ATmega644P, ATmega1284, ATmega1284P\r
* ATmega88, ATmega88P, ATmega168, ATmega168P, ATmega328P\r
*\r
- * $Id: irsnd.c,v 1.96 2015/11/17 13:51:45 fm Exp $\r
+ * $Id: irsnd.c,v 1.97 2015/11/18 08:27:50 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
//Nothing here to do here -> See irsndconfig.h\r
#elif defined (ARM_STM32) //STM32\r
//Nothing here to do here -> See irsndconfig.h\r
-#elif defined (TEENSY_ARM_CORTEX_M4) // Teensy3\r
+#elif defined (TEENSY_ARM_CORTEX_M4) // Teensy3\r
# if !digitalPinHasPWM(IRSND_PIN)\r
# error need pin with PWM output.\r
# endif\r
# define IRSND_FREQ_40_KHZ (IRSND_FREQ_TYPE) (40000)\r
# define IRSND_FREQ_56_KHZ (IRSND_FREQ_TYPE) (56000)\r
# define IRSND_FREQ_455_KHZ (IRSND_FREQ_TYPE) (455000)\r
-#elif defined (TEENSY_ARM_CORTEX_M4) // TEENSY\r
+#elif defined (TEENSY_ARM_CORTEX_M4) // TEENSY\r
# define IRSND_FREQ_TYPE float\r
# define IRSND_FREQ_30_KHZ (IRSND_FREQ_TYPE) (30000)\r
# define IRSND_FREQ_32_KHZ (IRSND_FREQ_TYPE) (32000)\r
{\r
#ifndef ANALYZE\r
# if defined(PIC_C18) // PIC C18\r
- PWMon();\r
- // IRSND_PIN = 0; // output mode -> enable PWM outout pin (0=PWM on, 1=PWM off)\r
+ PWMon();\r
+ // IRSND_PIN = 0; // output mode -> enable PWM outout pin (0=PWM on, 1=PWM off)\r
\r
# elif defined (ARM_STM32) // STM32\r
- TIM_SelectOCxM(IRSND_TIMER, IRSND_TIMER_CHANNEL, TIM_OCMode_PWM1); // enable PWM as OC-mode\r
- TIM_CCxCmd(IRSND_TIMER, IRSND_TIMER_CHANNEL, TIM_CCx_Enable); // enable OC-output (is being disabled in TIM_SelectOCxM())\r
- TIM_Cmd(IRSND_TIMER, ENABLE); // enable counter\r
+ TIM_SelectOCxM(IRSND_TIMER, IRSND_TIMER_CHANNEL, TIM_OCMode_PWM1); // enable PWM as OC-mode\r
+ TIM_CCxCmd(IRSND_TIMER, IRSND_TIMER_CHANNEL, TIM_CCx_Enable); // enable OC-output (is being disabled in TIM_SelectOCxM())\r
+ TIM_Cmd(IRSND_TIMER, ENABLE); // enable counter\r
\r
-# elif defined (TEENSY_ARM_CORTEX_M4) // TEENSY\r
- analogWrite(IRSND_PIN, 33 * 255 / 100); // pwm 33%\r
+# elif defined (TEENSY_ARM_CORTEX_M4) // TEENSY\r
+ analogWrite(IRSND_PIN, 33 * 255 / 100); // pwm 33%\r
\r
# elif defined (__AVR_XMEGA__) \r
# if (IRSND_OCx == IRSND_XMEGA_OC0A) // use OC0A\r
- XMEGA_Timer.CTRLB |= (1<<TC0_CCAEN_bp); // Compare A \r
+ XMEGA_Timer.CTRLB |= (1<<TC0_CCAEN_bp); // Compare A \r
# elif (IRSND_OCx == IRSND_XMEGA_OC0B) // use OC0B\r
- XMEGA_Timer.CTRLB |= (1<<TC0_CCBEN_bp); // Compare B \r
+ XMEGA_Timer.CTRLB |= (1<<TC0_CCBEN_bp); // Compare B \r
# elif IRSND_OCx == IRSND_XMEGA_OC0C // use OC0C\r
- XMEGA_Timer.CTRLB |= (1<<TC0_CCCEN_bp); // Compare C\r
+ XMEGA_Timer.CTRLB |= (1<<TC0_CCCEN_bp); // Compare C\r
# elif IRSND_OCx == IRSND_XMEGA_OC0D // use OC0D\r
- XMEGA_Timer.CTRLB |= (1<<TC0_CCDEN_bp); // Compare D\r
+ XMEGA_Timer.CTRLB |= (1<<TC0_CCDEN_bp); // Compare D\r
# elif IRSND_OCx == IRSND_XMEGA_OC1A // use OC1A\r
- XMEGA_Timer.CTRLB |= (1<<TC1_CCAEN_bp); // Compare A\r
+ XMEGA_Timer.CTRLB |= (1<<TC1_CCAEN_bp); // Compare A\r
# elif IRSND_OCx == IRSND_XMEGA_OC1B // use OC1B\r
- XMEGA_Timer.CTRLB |= (1<<TC1_CCBEN_bp); // Compare B\r
+ XMEGA_Timer.CTRLB |= (1<<TC1_CCBEN_bp); // Compare B\r
# else\r
# error wrong value of IRSND_OCx\r
# endif // IRSND_OCx\r
\r
# else // AVR\r
# if IRSND_OCx == IRSND_OC2 // use OC2\r
- TCCR2 |= (1<<COM20)|(1<<WGM21); // toggle OC2 on compare match, clear Timer 2 at compare match OCR2\r
+ TCCR2 |= (1<<COM20)|(1<<WGM21); // toggle OC2 on compare match, clear Timer 2 at compare match OCR2\r
# elif IRSND_OCx == IRSND_OC2A // use OC2A\r
- TCCR2A |= (1<<COM2A0)|(1<<WGM21); // toggle OC2A on compare match, clear Timer 2 at compare match OCR2A\r
+ TCCR2A |= (1<<COM2A0)|(1<<WGM21); // toggle OC2A on compare match, clear Timer 2 at compare match OCR2A\r
# elif IRSND_OCx == IRSND_OC2B // use OC2B\r
- TCCR2A |= (1<<COM2B0)|(1<<WGM21); // toggle OC2B on compare match, clear Timer 2 at compare match OCR2A (yes: A, not B!)\r
+ TCCR2A |= (1<<COM2B0)|(1<<WGM21); // toggle OC2B on compare match, clear Timer 2 at compare match OCR2A (yes: A, not B!)\r
# elif IRSND_OCx == IRSND_OC0 // use OC0\r
- TCCR0 |= (1<<COM00)|(1<<WGM01); // toggle OC0 on compare match, clear Timer 0 at compare match OCR0\r
+ TCCR0 |= (1<<COM00)|(1<<WGM01); // toggle OC0 on compare match, clear Timer 0 at compare match OCR0\r
# elif IRSND_OCx == IRSND_OC0A // use OC0A\r
- TCCR0A |= (1<<COM0A0)|(1<<WGM01); // toggle OC0A on compare match, clear Timer 0 at compare match OCR0A\r
+ TCCR0A |= (1<<COM0A0)|(1<<WGM01); // toggle OC0A on compare match, clear Timer 0 at compare match OCR0A\r
# elif IRSND_OCx == IRSND_OC0B // use OC0B\r
- TCCR0A |= (1<<COM0B0)|(1<<WGM01); // toggle OC0B on compare match, clear Timer 0 at compare match OCR0A (yes: A, not B!)\r
+ TCCR0A |= (1<<COM0B0)|(1<<WGM01); // toggle OC0B on compare match, clear Timer 0 at compare match OCR0A (yes: A, not B!)\r
# else\r
# error wrong value of IRSND_OCx\r
# endif // IRSND_OCx\r
#endif // ANALYZE\r
\r
#if IRSND_USE_CALLBACK == 1\r
- if (irsnd_callback_ptr)\r
- {\r
- (*irsnd_callback_ptr) (TRUE);\r
- }\r
+ if (irsnd_callback_ptr)\r
+ {\r
+ (*irsnd_callback_ptr) (TRUE);\r
+ }\r
#endif // IRSND_USE_CALLBACK == 1\r
\r
- irsnd_is_on = TRUE;\r
+ irsnd_is_on = TRUE;\r
}\r
}\r
\r
#ifndef ANALYZE\r
\r
# if defined(PIC_C18) // PIC C18\r
- PWMoff();\r
- // IRSND_PIN = 1; //input mode -> disbale PWM output pin (0=PWM on, 1=PWM off)\r
+ PWMoff();\r
+ // IRSND_PIN = 1; //input mode -> disbale PWM output pin (0=PWM on, 1=PWM off)\r
\r
# elif defined (ARM_STM32) // STM32\r
- TIM_Cmd(IRSND_TIMER, DISABLE); // disable counter\r
- TIM_SelectOCxM(IRSND_TIMER, IRSND_TIMER_CHANNEL, TIM_ForcedAction_InActive); // force output inactive\r
- TIM_CCxCmd(IRSND_TIMER, IRSND_TIMER_CHANNEL, TIM_CCx_Enable); // enable OC-output (is being disabled in TIM_SelectOCxM())\r
- TIM_SetCounter(IRSND_TIMER, 0); // reset counter value\r
+ TIM_Cmd(IRSND_TIMER, DISABLE); // disable counter\r
+ TIM_SelectOCxM(IRSND_TIMER, IRSND_TIMER_CHANNEL, TIM_ForcedAction_InActive); // force output inactive\r
+ TIM_CCxCmd(IRSND_TIMER, IRSND_TIMER_CHANNEL, TIM_CCx_Enable); // enable OC-output (is being disabled in TIM_SelectOCxM())\r
+ TIM_SetCounter(IRSND_TIMER, 0); // reset counter value\r
\r
-# elif defined (TEENSY_ARM_CORTEX_M4) // TEENSY\r
+# elif defined (TEENSY_ARM_CORTEX_M4) // TEENSY\r
analogWrite(IRSND_PIN, 0); // pwm off, LOW level\r
\r
# elif defined (__AVR_XMEGA__)\r
# if (IRSND_OCx == IRSND_XMEGA_OC0A) // use OC0A \r
- XMEGA_Timer.CTRLB &= ~(1<<TC0_CCAEN_bp); // Compare A disconnected\r
+ XMEGA_Timer.CTRLB &= ~(1<<TC0_CCAEN_bp); // Compare A disconnected\r
# elif (IRSND_OCx == IRSND_XMEGA_OC0B) // use OC0B \r
- XMEGA_Timer.CTRLB &= ~(1<<TC0_CCBEN_bp); // Compare B disconnected\r
+ XMEGA_Timer.CTRLB &= ~(1<<TC0_CCBEN_bp); // Compare B disconnected\r
# elif IRSND_OCx == IRSND_XMEGA_OC0C // use OC0C\r
- XMEGA_Timer.CTRLB &= ~(1<<TC0_CCCEN_bp); // Compare C disconnected\r
+ XMEGA_Timer.CTRLB &= ~(1<<TC0_CCCEN_bp); // Compare C disconnected\r
# elif IRSND_OCx == IRSND_XMEGA_OC0D // use OC0D\r
- XMEGA_Timer.CTRLB &= ~(1<<TC0_CCDEN_bp); // Compare D disconnected\r
+ XMEGA_Timer.CTRLB &= ~(1<<TC0_CCDEN_bp); // Compare D disconnected\r
# elif IRSND_OCx == IRSND_XMEGA_OC1A // use OC1A\r
- XMEGA_Timer.CTRLB &= ~(1<<TC1_CCAEN_bp); // Compare A disconnected\r
+ XMEGA_Timer.CTRLB &= ~(1<<TC1_CCAEN_bp); // Compare A disconnected\r
# elif IRSND_OCx == IRSND_XMEGA_OC1B // use OC1B\r
- XMEGA_Timer.CTRLB &= ~(1<<TC1_CCBEN_bp); // Compare B disconnected\r
+ XMEGA_Timer.CTRLB &= ~(1<<TC1_CCBEN_bp); // Compare B disconnected\r
# else\r
# error wrong value of IRSND_OCx\r
# endif // IRSND_OCx\r
# else //AVR\r
\r
# if IRSND_OCx == IRSND_OC2 // use OC2\r
- TCCR2 &= ~(1<<COM20); // normal port operation, OC2 disconnected.\r
+ TCCR2 &= ~(1<<COM20); // normal port operation, OC2 disconnected.\r
# elif IRSND_OCx == IRSND_OC2A // use OC2A\r
- TCCR2A &= ~(1<<COM2A0); // normal port operation, OC2A disconnected.\r
+ TCCR2A &= ~(1<<COM2A0); // normal port operation, OC2A disconnected.\r
# elif IRSND_OCx == IRSND_OC2B // use OC2B\r
- TCCR2A &= ~(1<<COM2B0); // normal port operation, OC2B disconnected.\r
+ TCCR2A &= ~(1<<COM2B0); // normal port operation, OC2B disconnected.\r
# elif IRSND_OCx == IRSND_OC0 // use OC0\r
- TCCR0 &= ~(1<<COM00); // normal port operation, OC0 disconnected.\r
+ TCCR0 &= ~(1<<COM00); // normal port operation, OC0 disconnected.\r
# elif IRSND_OCx == IRSND_OC0A // use OC0A\r
- TCCR0A &= ~(1<<COM0A0); // normal port operation, OC0A disconnected.\r
+ TCCR0A &= ~(1<<COM0A0); // normal port operation, OC0A disconnected.\r
# elif IRSND_OCx == IRSND_OC0B // use OC0B\r
- TCCR0A &= ~(1<<COM0B0); // normal port operation, OC0B disconnected.\r
+ TCCR0A &= ~(1<<COM0B0); // normal port operation, OC0B disconnected.\r
# else\r
# error wrong value of IRSND_OCx\r
# endif // IRSND_OCx\r
- IRSND_PORT &= ~(1<<IRSND_BIT); // set IRSND_BIT to low\r
+ IRSND_PORT &= ~(1<<IRSND_BIT); // set IRSND_BIT to low\r
# endif //C18\r
#endif // ANALYZE\r
\r
#if IRSND_USE_CALLBACK == 1\r
- if (irsnd_callback_ptr)\r
- {\r
- (*irsnd_callback_ptr) (FALSE);\r
- }\r
+ if (irsnd_callback_ptr)\r
+ {\r
+ (*irsnd_callback_ptr) (FALSE);\r
+ }\r
#endif // IRSND_USE_CALLBACK == 1\r
\r
- irsnd_is_on = FALSE;\r
+ irsnd_is_on = FALSE;\r
}\r
}\r
\r
#ifndef ANALYZE\r
# if defined(PIC_C18) // PIC C18 or XC8\r
# if defined(__12F1840) // XC8\r
- TRISA2=0; \r
- PR2=freq;\r
- CCP1M0=1;\r
- CCP1M1=1;\r
- CCP1M2=1;\r
- CCP1M3=1;\r
- DC1B0=1;\r
- DC1B1=0;\r
- CCPR1L = 0b01101001;\r
- TMR2IF = 0;\r
- TMR2ON=1;\r
- CCP1CON &=(~0b0011); // p 197 "active high"\r
+ TRISA2=0; \r
+ PR2=freq;\r
+ CCP1M0=1;\r
+ CCP1M1=1;\r
+ CCP1M2=1;\r
+ CCP1M3=1;\r
+ DC1B0=1;\r
+ DC1B1=0;\r
+ CCPR1L = 0b01101001;\r
+ TMR2IF = 0;\r
+ TMR2ON=1;\r
+ CCP1CON &=(~0b0011); // p 197 "active high"\r
# else // PIC C18\r
- OpenPWM(freq); \r
- SetDCPWM( (uint16_t) (freq * 2) + 1); // freq*2 = Duty cycles 50%\r
+ OpenPWM(freq); \r
+ SetDCPWM( (uint16_t) (freq * 2) + 1); // freq*2 = Duty cycles 50%\r
# endif\r
- PWMoff();\r
+ PWMoff();\r
# elif defined (ARM_STM32) // STM32\r
- static uint32_t TimeBaseFreq = 0;\r
+ static uint32_t TimeBaseFreq = 0;\r
\r
- if (TimeBaseFreq == 0)\r
- {\r
- RCC_ClocksTypeDef RCC_ClocksStructure;\r
- /* Get system clocks and store timer clock in variable */\r
- RCC_GetClocksFreq(&RCC_ClocksStructure);\r
+ if (TimeBaseFreq == 0)\r
+ {\r
+ RCC_ClocksTypeDef RCC_ClocksStructure;\r
+ /* Get system clocks and store timer clock in variable */\r
+ RCC_GetClocksFreq(&RCC_ClocksStructure);\r
# if ((IRSND_TIMER_NUMBER >= 2) && (IRSND_TIMER_NUMBER <= 5)) || ((IRSND_TIMER_NUMBER >= 12) && (IRSND_TIMER_NUMBER <= 14))\r
- if (RCC_ClocksStructure.PCLK1_Frequency == RCC_ClocksStructure.HCLK_Frequency)\r
- {\r
- TimeBaseFreq = RCC_ClocksStructure.PCLK1_Frequency;\r
- }\r
- else\r
- {\r
- TimeBaseFreq = RCC_ClocksStructure.PCLK1_Frequency * 2;\r
- }\r
+ if (RCC_ClocksStructure.PCLK1_Frequency == RCC_ClocksStructure.HCLK_Frequency)\r
+ {\r
+ TimeBaseFreq = RCC_ClocksStructure.PCLK1_Frequency;\r
+ }\r
+ else\r
+ {\r
+ TimeBaseFreq = RCC_ClocksStructure.PCLK1_Frequency * 2;\r
+ }\r
# else\r
- if (RCC_ClocksStructure.PCLK2_Frequency == RCC_ClocksStructure.HCLK_Frequency)\r
- {\r
- TimeBaseFreq = RCC_ClocksStructure.PCLK2_Frequency;\r
- }\r
- else\r
- {\r
- TimeBaseFreq = RCC_ClocksStructure.PCLK2_Frequency * 2;\r
- }\r
+ if (RCC_ClocksStructure.PCLK2_Frequency == RCC_ClocksStructure.HCLK_Frequency)\r
+ {\r
+ TimeBaseFreq = RCC_ClocksStructure.PCLK2_Frequency;\r
+ }\r
+ else\r
+ {\r
+ TimeBaseFreq = RCC_ClocksStructure.PCLK2_Frequency * 2;\r
+ }\r
# endif\r
- }\r
+ }\r
\r
- freq = TimeBaseFreq/freq;\r
+ freq = TimeBaseFreq/freq;\r
\r
- /* Set frequency */\r
- TIM_SetAutoreload(IRSND_TIMER, freq - 1);\r
- /* Set duty cycle */\r
- TIM_SetCompare1(IRSND_TIMER, (freq + 1) / 2);\r
+ /* Set frequency */\r
+ TIM_SetAutoreload(IRSND_TIMER, freq - 1);\r
+ /* Set duty cycle */\r
+ TIM_SetCompare1(IRSND_TIMER, (freq + 1) / 2);\r
\r
# elif defined (TEENSY_ARM_CORTEX_M4)\r
- analogWriteResolution(8); // 8 bit\r
+ analogWriteResolution(8); // 8 bit\r
analogWriteFrequency(IRSND_PIN, freq);\r
analogWrite(IRSND_PIN, 0); // pwm off, LOW level\r
\r
# elif defined (__AVR_XMEGA__)\r
- XMEGA_Timer.CCA = freq;\r
+ XMEGA_Timer.CCA = freq;\r
\r
# else // AVR\r
\r
# if IRSND_OCx == IRSND_OC2\r
- OCR2 = freq; // use register OCR2 for OC2\r
+ OCR2 = freq; // use register OCR2 for OC2\r
# elif IRSND_OCx == IRSND_OC2A // use OC2A\r
- OCR2A = freq; // use register OCR2A for OC2A and OC2B!\r
+ OCR2A = freq; // use register OCR2A for OC2A and OC2B!\r
# elif IRSND_OCx == IRSND_OC2B // use OC2B\r
- OCR2A = freq; // use register OCR2A for OC2A and OC2B!\r
+ OCR2A = freq; // use register OCR2A for OC2A and OC2B!\r
# elif IRSND_OCx == IRSND_OC0 // use OC0\r
- OCR0 = freq; // use register OCR2 for OC2\r
+ OCR0 = freq; // use register OCR2 for OC2\r
# elif IRSND_OCx == IRSND_OC0A // use OC0A\r
- OCR0A = freq; // use register OCR0A for OC0A and OC0B!\r
+ OCR0A = freq; // use register OCR0A for OC0A and OC0B!\r
# elif IRSND_OCx == IRSND_OC0B // use OC0B\r
- OCR0A = freq; // use register OCR0A for OC0A and OC0B!\r
+ OCR0A = freq; // use register OCR0A for OC0A and OC0B!\r
# else\r
# error wrong value of IRSND_OCx\r
# endif\r
#ifndef ANALYZE\r
# if defined(PIC_C18) // PIC C18 or XC8 compiler\r
# if ! defined(__12F1840) // only C18:\r
- OpenTimer;\r
+ OpenTimer;\r
# endif\r
- irsnd_set_freq (IRSND_FREQ_36_KHZ); // default frequency\r
- IRSND_PIN = 0; // set IO to outout\r
- PWMoff();\r
+ irsnd_set_freq (IRSND_FREQ_36_KHZ); // default frequency\r
+ IRSND_PIN = 0; // set IO to outout\r
+ PWMoff();\r
# elif defined (ARM_STM32) // STM32\r
- GPIO_InitTypeDef GPIO_InitStructure;\r
- TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;\r
- TIM_OCInitTypeDef TIM_OCInitStructure;\r
+ GPIO_InitTypeDef GPIO_InitStructure;\r
+ TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;\r
+ TIM_OCInitTypeDef TIM_OCInitStructure;\r
\r
/* GPIOx clock enable */\r
# if defined (ARM_STM32L1XX)\r
- RCC_AHBPeriphClockCmd(IRSND_PORT_RCC, ENABLE);\r
+ RCC_AHBPeriphClockCmd(IRSND_PORT_RCC, ENABLE);\r
# elif defined (ARM_STM32F10X)\r
- RCC_APB2PeriphClockCmd(IRSND_PORT_RCC, ENABLE);\r
- // RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE); // only in case of remapping, not necessary for default port-timer mapping\r
+ RCC_APB2PeriphClockCmd(IRSND_PORT_RCC, ENABLE);\r
+ // RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE); // only in case of remapping, not necessary for default port-timer mapping\r
# elif defined (ARM_STM32F4XX)\r
- RCC_AHB1PeriphClockCmd(IRSND_PORT_RCC, ENABLE);\r
+ RCC_AHB1PeriphClockCmd(IRSND_PORT_RCC, ENABLE);\r
# endif\r
\r
- /* GPIO Configuration */\r
- GPIO_InitStructure.GPIO_Pin = IRSND_BIT;\r
+ /* GPIO Configuration */\r
+ GPIO_InitStructure.GPIO_Pin = IRSND_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
- GPIO_Init(IRSND_PORT, &GPIO_InitStructure);\r
- GPIO_PinAFConfig(IRSND_PORT, (uint8_t)IRSND_BIT_NUMBER, IRSND_GPIO_AF);\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
+ GPIO_Init(IRSND_PORT, &GPIO_InitStructure);\r
+ GPIO_PinAFConfig(IRSND_PORT, (uint8_t)IRSND_BIT_NUMBER, IRSND_GPIO_AF);\r
# elif defined (ARM_STM32F10X)\r
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;\r
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;\r
- GPIO_Init(IRSND_PORT, &GPIO_InitStructure);\r
- // GPIO_PinRemapConfig(GPIO_*Remap*_TIM[IRSND_TIMER_NUMBER], ENABLE); // only in case of remapping, not necessary for default port-timer mapping\r
+ GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;\r
+ GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;\r
+ GPIO_Init(IRSND_PORT, &GPIO_InitStructure);\r
+ // GPIO_PinRemapConfig(GPIO_*Remap*_TIM[IRSND_TIMER_NUMBER], ENABLE); // only in case of remapping, not necessary for default port-timer mapping\r
# endif\r
\r
- /* TIMx clock enable */\r
+ /* TIMx clock enable */\r
# if ((IRSND_TIMER_NUMBER >= 2) && (IRSND_TIMER_NUMBER <= 5)) || ((IRSND_TIMER_NUMBER >= 12) && (IRSND_TIMER_NUMBER <= 14))\r
- RCC_APB1PeriphClockCmd(IRSND_TIMER_RCC, ENABLE);\r
+ RCC_APB1PeriphClockCmd(IRSND_TIMER_RCC, ENABLE);\r
# else\r
- RCC_APB2PeriphClockCmd(IRSND_TIMER_RCC, ENABLE);\r
+ RCC_APB2PeriphClockCmd(IRSND_TIMER_RCC, ENABLE);\r
# endif\r
\r
- /* Time base configuration */\r
- TIM_TimeBaseStructure.TIM_Period = -1; // set dummy value (don't set to 0), will be initialized later\r
- TIM_TimeBaseStructure.TIM_Prescaler = 0;\r
- TIM_TimeBaseStructure.TIM_ClockDivision = 0;\r
- TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;\r
- TIM_TimeBaseInit(IRSND_TIMER, &TIM_TimeBaseStructure);\r
+ /* Time base configuration */\r
+ TIM_TimeBaseStructure.TIM_Period = -1; // set dummy value (don't set to 0), will be initialized later\r
+ TIM_TimeBaseStructure.TIM_Prescaler = 0;\r
+ TIM_TimeBaseStructure.TIM_ClockDivision = 0;\r
+ TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;\r
+ TIM_TimeBaseInit(IRSND_TIMER, &TIM_TimeBaseStructure);\r
\r
- /* PWM1 Mode configuration */\r
- TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1;\r
- TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable;\r
- TIM_OCInitStructure.TIM_Pulse = 0; // will be initialized later\r
- TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_High;\r
- TIM_OC1Init(IRSND_TIMER, &TIM_OCInitStructure);\r
+ /* PWM1 Mode configuration */\r
+ TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1;\r
+ TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable;\r
+ TIM_OCInitStructure.TIM_Pulse = 0; // will be initialized later\r
+ TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_High;\r
+ TIM_OC1Init(IRSND_TIMER, &TIM_OCInitStructure);\r
\r
- /* Preload configuration */\r
- TIM_ARRPreloadConfig(IRSND_TIMER, ENABLE);\r
- TIM_OC1PreloadConfig(IRSND_TIMER, TIM_OCPreload_Enable);\r
+ /* Preload configuration */\r
+ TIM_ARRPreloadConfig(IRSND_TIMER, ENABLE);\r
+ TIM_OC1PreloadConfig(IRSND_TIMER, TIM_OCPreload_Enable);\r
\r
- irsnd_set_freq (IRSND_FREQ_36_KHZ); // set default frequency\r
+ irsnd_set_freq (IRSND_FREQ_36_KHZ); // set default frequency\r
\r
# elif defined (TEENSY_ARM_CORTEX_M4)\r
if (!digitalPinHasPWM(IRSND_PIN))\r
- {\r
- return;\r
+ {\r
+ return;\r
}\r
\r
# elif defined (__AVR_XMEGA__)\r
- IRSND_PORT &= ~(1<<IRSND_BIT); // set IRSND_BIT to low\r
- IRSND_DDR |= (1<<IRSND_BIT); // set IRSND_BIT to output\r
+ IRSND_PORT &= ~(1<<IRSND_BIT); // set IRSND_BIT to low\r
+ IRSND_DDR |= (1<<IRSND_BIT); // set IRSND_BIT to output\r
\r
- XMEGA_Timer.PER = 0xFFFF; //Topwert\r
- XMEGA_Timer.CTRLB |= TC_WGMODE_FRQ_gc; //Modus: Frequenz entspricht CTC\r
+ XMEGA_Timer.PER = 0xFFFF; //Topwert\r
+ XMEGA_Timer.CTRLB |= TC_WGMODE_FRQ_gc; //Modus: Frequenz entspricht CTC\r
\r
# if AVR_PRESCALER == 8\r
- XMEGA_Timer.CTRLA |= TC_CLKSEL_DIV8_gc; // start Timer prescaler = 8\r
+ XMEGA_Timer.CTRLA |= TC_CLKSEL_DIV8_gc; // start Timer prescaler = 8\r
# else\r
- XMEGA_Timer.CTRLA |= TC_CLKSEL_DIV1_gc; // start Timer prescaler = 1\r
+ XMEGA_Timer.CTRLA |= TC_CLKSEL_DIV1_gc; // start Timer prescaler = 1\r
# endif\r
- \r
+ \r
# else // AVR\r
- IRSND_PORT &= ~(1<<IRSND_BIT); // set IRSND_BIT to low\r
- IRSND_DDR |= (1<<IRSND_BIT); // set IRSND_BIT to output\r
+ IRSND_PORT &= ~(1<<IRSND_BIT); // set IRSND_BIT to low\r
+ IRSND_DDR |= (1<<IRSND_BIT); // set IRSND_BIT to output\r
\r
# if IRSND_OCx == IRSND_OC2 // use OC2\r
- TCCR2 = (1<<WGM21); // CTC mode\r
+ TCCR2 = (1<<WGM21); // CTC mode\r
# if AVR_PRESCALER == 8\r
- TCCR2 |= (1<<CS21); // start Timer 2, prescaler = 8\r
+ TCCR2 |= (1<<CS21); // start Timer 2, prescaler = 8\r
# else\r
- TCCR2 |= (1<<CS20); // start Timer 2, prescaler = 1\r
+ TCCR2 |= (1<<CS20); // start Timer 2, prescaler = 1\r
# endif\r
# elif IRSND_OCx == IRSND_OC2A || IRSND_OCx == IRSND_OC2B // use OC2A or OC2B\r
- TCCR2A = (1<<WGM21); // CTC mode\r
+ TCCR2A = (1<<WGM21); // CTC mode\r
# if AVR_PRESCALER == 8\r
- TCCR2B = (1<<CS21); // start Timer 2, prescaler = 8\r
+ TCCR2B = (1<<CS21); // start Timer 2, prescaler = 8\r
# else\r
- TCCR2B = (1<<CS20); // start Timer 2, prescaler = 1\r
+ TCCR2B = (1<<CS20); // start Timer 2, prescaler = 1\r
# endif\r
# elif IRSND_OCx == IRSND_OC0 // use OC0\r
- TCCR0 = (1<<WGM01); // CTC mode\r
+ TCCR0 = (1<<WGM01); // CTC mode\r
# if AVR_PRESCALER == 8\r
- TCCR0 |= (1<<CS01); // start Timer 0, prescaler = 8\r
+ TCCR0 |= (1<<CS01); // start Timer 0, prescaler = 8\r
# else\r
- TCCR0 |= (1<<CS00); // start Timer 0, prescaler = 1\r
+ TCCR0 |= (1<<CS00); // start Timer 0, prescaler = 1\r
# endif\r
# elif IRSND_OCx == IRSND_OC0A || IRSND_OCx == IRSND_OC0B // use OC0A or OC0B\r
- TCCR0A = (1<<WGM01); // CTC mode\r
+ TCCR0A = (1<<WGM01); // CTC mode\r
# if AVR_PRESCALER == 8\r
- TCCR0B = (1<<CS01); // start Timer 0, prescaler = 8\r
+ TCCR0B = (1<<CS01); // start Timer 0, prescaler = 8\r
# else\r
- TCCR0B = (1<<CS00); // start Timer 0, prescaler = 1\r
+ TCCR0B = (1<<CS00); // start Timer 0, prescaler = 1\r
# endif\r
# else\r
# error wrong value of IRSND_OCx\r
# endif\r
- irsnd_set_freq (IRSND_FREQ_36_KHZ); // default frequency\r
+ irsnd_set_freq (IRSND_FREQ_36_KHZ); // default frequency\r
# endif //PIC_C18\r
#endif // ANALYZE\r
}\r
\r
while(len)\r
{\r
- xx <<= 1;\r
- if (x & 1)\r
- {\r
- xx |= 1;\r
- }\r
- x >>= 1;\r
- len--;\r
+ xx <<= 1;\r
+ if (x & 1)\r
+ {\r
+ xx |= 1;\r
+ }\r
+ x >>= 1;\r
+ len--;\r
}\r
return xx;\r
}\r
\r
if (do_wait)\r
{\r
- while (irsnd_busy)\r
- {\r
- // do nothing;\r
- }\r
+ while (irsnd_busy)\r
+ {\r
+ // do nothing;\r
+ }\r
}\r
else if (irsnd_busy)\r
{\r
- return (FALSE);\r
+ return (FALSE);\r
}\r
\r
irsnd_protocol = irmp_data_p->protocol;\r
switch (irsnd_protocol)\r
{\r
#if IRSND_SUPPORT_SIRCS_PROTOCOL == 1\r
- case IRMP_SIRCS_PROTOCOL:\r
- {\r
- // uint8_t sircs_additional_command_len;\r
- uint8_t sircs_additional_address_len;\r
-\r
- sircs_additional_bitlen = (irmp_data_p->address & 0xFF00) >> 8; // additional bitlen\r
-\r
- if (sircs_additional_bitlen > 15 - SIRCS_MINIMUM_DATA_LEN)\r
- {\r
- // sircs_additional_command_len = 15 - SIRCS_MINIMUM_DATA_LEN;\r
- sircs_additional_address_len = sircs_additional_bitlen - (15 - SIRCS_MINIMUM_DATA_LEN);\r
- }\r
- else\r
- {\r
- // sircs_additional_command_len = sircs_additional_bitlen;\r
- sircs_additional_address_len = 0;\r
- }\r
-\r
- command = bitsrevervse (irmp_data_p->command, 15);\r
-\r
- irsnd_buffer[0] = (command & 0x7F80) >> 7; // CCCCCCCC\r
- irsnd_buffer[1] = (command & 0x007F) << 1; // CCCC****\r
-\r
- if (sircs_additional_address_len > 0)\r
- {\r
- address = bitsrevervse (irmp_data_p->address, 5);\r
- irsnd_buffer[1] |= (address & 0x0010) >> 4;\r
- irsnd_buffer[2] = (address & 0x000F) << 4;\r
- }\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ case IRMP_SIRCS_PROTOCOL:\r
+ {\r
+ // uint8_t sircs_additional_command_len;\r
+ uint8_t sircs_additional_address_len;\r
+\r
+ sircs_additional_bitlen = (irmp_data_p->address & 0xFF00) >> 8; // additional bitlen\r
+\r
+ if (sircs_additional_bitlen > 15 - SIRCS_MINIMUM_DATA_LEN)\r
+ {\r
+ // sircs_additional_command_len = 15 - SIRCS_MINIMUM_DATA_LEN;\r
+ sircs_additional_address_len = sircs_additional_bitlen - (15 - SIRCS_MINIMUM_DATA_LEN);\r
+ }\r
+ else\r
+ {\r
+ // sircs_additional_command_len = sircs_additional_bitlen;\r
+ sircs_additional_address_len = 0;\r
+ }\r
+\r
+ command = bitsrevervse (irmp_data_p->command, 15);\r
+\r
+ irsnd_buffer[0] = (command & 0x7F80) >> 7; // CCCCCCCC\r
+ irsnd_buffer[1] = (command & 0x007F) << 1; // CCCC****\r
+\r
+ if (sircs_additional_address_len > 0)\r
+ {\r
+ address = bitsrevervse (irmp_data_p->address, 5);\r
+ irsnd_buffer[1] |= (address & 0x0010) >> 4;\r
+ irsnd_buffer[2] = (address & 0x000F) << 4;\r
+ }\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_NEC_PROTOCOL == 1\r
- case IRMP_APPLE_PROTOCOL:\r
- {\r
- command = irmp_data_p->command | (irmp_data_p->address << 8); // store address as ID in upper byte of command\r
- address = 0x87EE; // set fixed NEC-lookalike address (customer ID of apple)\r
-\r
- address = bitsrevervse (address, NEC_ADDRESS_LEN);\r
- command = bitsrevervse (command, NEC_COMMAND_LEN);\r
-\r
- irsnd_protocol = IRMP_NEC_PROTOCOL; // APPLE protocol is NEC with id instead of inverted command\r
-\r
- irsnd_buffer[0] = (address & 0xFF00) >> 8; // AAAAAAAA\r
- irsnd_buffer[1] = (address & 0x00FF); // AAAAAAAA\r
- irsnd_buffer[2] = (command & 0xFF00) >> 8; // CCCCCCCC\r
- irsnd_buffer[3] = 0x8B; // 10001011 (id)\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
- case IRMP_NEC_PROTOCOL:\r
- {\r
- address = bitsrevervse (irmp_data_p->address, NEC_ADDRESS_LEN);\r
- command = bitsrevervse (irmp_data_p->command, NEC_COMMAND_LEN);\r
-\r
- irsnd_buffer[0] = (address & 0xFF00) >> 8; // AAAAAAAA\r
- irsnd_buffer[1] = (address & 0x00FF); // AAAAAAAA\r
- irsnd_buffer[2] = (command & 0xFF00) >> 8; // CCCCCCCC\r
- irsnd_buffer[3] = ~((command & 0xFF00) >> 8); // cccccccc\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ case IRMP_APPLE_PROTOCOL:\r
+ {\r
+ command = irmp_data_p->command | (irmp_data_p->address << 8); // store address as ID in upper byte of command\r
+ address = 0x87EE; // set fixed NEC-lookalike address (customer ID of apple)\r
+\r
+ address = bitsrevervse (address, NEC_ADDRESS_LEN);\r
+ command = bitsrevervse (command, NEC_COMMAND_LEN);\r
+\r
+ irsnd_protocol = IRMP_NEC_PROTOCOL; // APPLE protocol is NEC with id instead of inverted command\r
+\r
+ irsnd_buffer[0] = (address & 0xFF00) >> 8; // AAAAAAAA\r
+ irsnd_buffer[1] = (address & 0x00FF); // AAAAAAAA\r
+ irsnd_buffer[2] = (command & 0xFF00) >> 8; // CCCCCCCC\r
+ irsnd_buffer[3] = 0x8B; // 10001011 (id)\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
+ case IRMP_NEC_PROTOCOL:\r
+ {\r
+ address = bitsrevervse (irmp_data_p->address, NEC_ADDRESS_LEN);\r
+ command = bitsrevervse (irmp_data_p->command, NEC_COMMAND_LEN);\r
+\r
+ irsnd_buffer[0] = (address & 0xFF00) >> 8; // AAAAAAAA\r
+ irsnd_buffer[1] = (address & 0x00FF); // AAAAAAAA\r
+ irsnd_buffer[2] = (command & 0xFF00) >> 8; // CCCCCCCC\r
+ irsnd_buffer[3] = ~((command & 0xFF00) >> 8); // cccccccc\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_NEC16_PROTOCOL == 1\r
- case IRMP_NEC16_PROTOCOL:\r
- {\r
- address = bitsrevervse (irmp_data_p->address, NEC16_ADDRESS_LEN);\r
- command = bitsrevervse (irmp_data_p->command, NEC16_COMMAND_LEN);\r
-\r
- irsnd_buffer[0] = (address & 0x00FF); // AAAAAAAA\r
- irsnd_buffer[1] = (command & 0x00FF); // CCCCCCCC\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ case IRMP_NEC16_PROTOCOL:\r
+ {\r
+ address = bitsrevervse (irmp_data_p->address, NEC16_ADDRESS_LEN);\r
+ command = bitsrevervse (irmp_data_p->command, NEC16_COMMAND_LEN);\r
+\r
+ irsnd_buffer[0] = (address & 0x00FF); // AAAAAAAA\r
+ irsnd_buffer[1] = (command & 0x00FF); // CCCCCCCC\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_NEC42_PROTOCOL == 1\r
- case IRMP_NEC42_PROTOCOL:\r
- {\r
- address = bitsrevervse (irmp_data_p->address, NEC42_ADDRESS_LEN);\r
- command = bitsrevervse (irmp_data_p->command, NEC42_COMMAND_LEN);\r
-\r
- irsnd_buffer[0] = ( (address & 0x1FE0) >> 5); // AAAAAAAA\r
- irsnd_buffer[1] = ( (address & 0x001F) << 3) | ((~address & 0x1C00) >> 10); // AAAAAaaa\r
- irsnd_buffer[2] = ((~address & 0x03FC) >> 2); // aaaaaaaa\r
- irsnd_buffer[3] = ((~address & 0x0003) << 6) | ( (command & 0x00FC) >> 2); // aaCCCCCC\r
- irsnd_buffer[4] = ( (command & 0x0003) << 6) | ((~command & 0x00FC) >> 2); // CCcccccc\r
- irsnd_buffer[5] = ((~command & 0x0003) << 6); // cc\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ case IRMP_NEC42_PROTOCOL:\r
+ {\r
+ address = bitsrevervse (irmp_data_p->address, NEC42_ADDRESS_LEN);\r
+ command = bitsrevervse (irmp_data_p->command, NEC42_COMMAND_LEN);\r
+\r
+ irsnd_buffer[0] = ( (address & 0x1FE0) >> 5); // AAAAAAAA\r
+ irsnd_buffer[1] = ( (address & 0x001F) << 3) | ((~address & 0x1C00) >> 10); // AAAAAaaa\r
+ irsnd_buffer[2] = ((~address & 0x03FC) >> 2); // aaaaaaaa\r
+ irsnd_buffer[3] = ((~address & 0x0003) << 6) | ( (command & 0x00FC) >> 2); // aaCCCCCC\r
+ irsnd_buffer[4] = ( (command & 0x0003) << 6) | ((~command & 0x00FC) >> 2); // CCcccccc\r
+ irsnd_buffer[5] = ((~command & 0x0003) << 6); // cc\r
+ irsnd_busy = TRUE;\r
+ 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
+ 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
- address = bitsrevervse (irmp_data_p->address, SAMSUNG_ADDRESS_LEN);\r
- command = bitsrevervse (irmp_data_p->command, SAMSUNG_COMMAND_LEN);\r
-\r
- irsnd_buffer[0] = (address & 0xFF00) >> 8; // AAAAAAAA\r
- irsnd_buffer[1] = (address & 0x00FF); // AAAAAAAA\r
- irsnd_buffer[2] = (command & 0x00F0) | ((command & 0xF000) >> 12); // IIIICCCC\r
- irsnd_buffer[3] = ((command & 0x0F00) >> 4) | ((~(command & 0xF000) >> 12) & 0x0F); // CCCCcccc\r
- irsnd_buffer[4] = (~(command & 0x0F00) >> 4) & 0xF0; // cccc0000\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
- case IRMP_SAMSUNG32_PROTOCOL:\r
- {\r
- address = bitsrevervse (irmp_data_p->address, SAMSUNG_ADDRESS_LEN);\r
- command = bitsrevervse (irmp_data_p->command, SAMSUNG32_COMMAND_LEN);\r
-\r
- irsnd_buffer[0] = (address & 0xFF00) >> 8; // AAAAAAAA\r
- irsnd_buffer[1] = (address & 0x00FF); // AAAAAAAA\r
- irsnd_buffer[2] = (command & 0xFF00) >> 8; // CCCCCCCC\r
- irsnd_buffer[3] = (command & 0x00FF); // CCCCCCCC\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ case IRMP_SAMSUNG_PROTOCOL:\r
+ {\r
+ address = bitsrevervse (irmp_data_p->address, SAMSUNG_ADDRESS_LEN);\r
+ command = bitsrevervse (irmp_data_p->command, SAMSUNG_COMMAND_LEN);\r
+\r
+ irsnd_buffer[0] = (address & 0xFF00) >> 8; // AAAAAAAA\r
+ irsnd_buffer[1] = (address & 0x00FF); // AAAAAAAA\r
+ irsnd_buffer[2] = (command & 0x00F0) | ((command & 0xF000) >> 12); // IIIICCCC\r
+ irsnd_buffer[3] = ((command & 0x0F00) >> 4) | ((~(command & 0xF000) >> 12) & 0x0F); // CCCCcccc\r
+ irsnd_buffer[4] = (~(command & 0x0F00) >> 4) & 0xF0; // cccc0000\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
+ case IRMP_SAMSUNG32_PROTOCOL:\r
+ {\r
+ address = bitsrevervse (irmp_data_p->address, SAMSUNG_ADDRESS_LEN);\r
+ command = bitsrevervse (irmp_data_p->command, SAMSUNG32_COMMAND_LEN);\r
+\r
+ irsnd_buffer[0] = (address & 0xFF00) >> 8; // AAAAAAAA\r
+ irsnd_buffer[1] = (address & 0x00FF); // AAAAAAAA\r
+ irsnd_buffer[2] = (command & 0xFF00) >> 8; // CCCCCCCC\r
+ irsnd_buffer[3] = (command & 0x00FF); // CCCCCCCC\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_SAMSUNG48_PROTOCOL == 1\r
- case IRMP_SAMSUNG48_PROTOCOL:\r
- {\r
- address = bitsrevervse (irmp_data_p->address, SAMSUNG_ADDRESS_LEN);\r
- command = bitsrevervse (irmp_data_p->command, 16);\r
-\r
- irsnd_buffer[0] = (address & 0xFF00) >> 8; // AAAAAAAA\r
- irsnd_buffer[1] = (address & 0x00FF); // AAAAAAAA\r
- irsnd_buffer[2] = ((command & 0xFF00) >> 8); // CCCCCCCC\r
- irsnd_buffer[3] = ~((command & 0xFF00) >> 8); // cccccccc\r
- irsnd_buffer[4] = (command & 0x00FF); // CCCCCCCC\r
- irsnd_buffer[5] = ~(command & 0x00FF); // cccccccc\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ case IRMP_SAMSUNG48_PROTOCOL:\r
+ {\r
+ address = bitsrevervse (irmp_data_p->address, SAMSUNG_ADDRESS_LEN);\r
+ command = bitsrevervse (irmp_data_p->command, 16);\r
+\r
+ irsnd_buffer[0] = (address & 0xFF00) >> 8; // AAAAAAAA\r
+ irsnd_buffer[1] = (address & 0x00FF); // AAAAAAAA\r
+ irsnd_buffer[2] = ((command & 0xFF00) >> 8); // CCCCCCCC\r
+ irsnd_buffer[3] = ~((command & 0xFF00) >> 8); // cccccccc\r
+ irsnd_buffer[4] = (command & 0x00FF); // CCCCCCCC\r
+ irsnd_buffer[5] = ~(command & 0x00FF); // cccccccc\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_MATSUSHITA_PROTOCOL == 1\r
- case IRMP_MATSUSHITA_PROTOCOL:\r
- {\r
- address = bitsrevervse (irmp_data_p->address, MATSUSHITA_ADDRESS_LEN);\r
- command = bitsrevervse (irmp_data_p->command, MATSUSHITA_COMMAND_LEN);\r
-\r
- irsnd_buffer[0] = (command & 0x0FF0) >> 4; // CCCCCCCC\r
- irsnd_buffer[1] = ((command & 0x000F) << 4) | ((address & 0x0F00) >> 8); // CCCCAAAA\r
- irsnd_buffer[2] = (address & 0x00FF); // AAAAAAAA\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ case IRMP_MATSUSHITA_PROTOCOL:\r
+ {\r
+ address = bitsrevervse (irmp_data_p->address, MATSUSHITA_ADDRESS_LEN);\r
+ command = bitsrevervse (irmp_data_p->command, MATSUSHITA_COMMAND_LEN);\r
+\r
+ irsnd_buffer[0] = (command & 0x0FF0) >> 4; // CCCCCCCC\r
+ irsnd_buffer[1] = ((command & 0x000F) << 4) | ((address & 0x0F00) >> 8); // CCCCAAAA\r
+ irsnd_buffer[2] = (address & 0x00FF); // AAAAAAAA\r
+ irsnd_busy = TRUE;\r
+ 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
+ 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
- uint8_t xor_value;\r
- uint16_t genre2;\r
+ case IRMP_KASEIKYO_PROTOCOL:\r
+ {\r
+ uint8_t xor_value;\r
+ uint16_t genre2;\r
\r
- address = bitsrevervse (irmp_data_p->address, KASEIKYO_ADDRESS_LEN);\r
- command = bitsrevervse (irmp_data_p->command, KASEIKYO_COMMAND_LEN + 4);\r
- genre2 = bitsrevervse ((irmp_data_p->flags & ~IRSND_REPETITION_MASK) >> 4, 4);\r
+ address = bitsrevervse (irmp_data_p->address, KASEIKYO_ADDRESS_LEN);\r
+ command = bitsrevervse (irmp_data_p->command, KASEIKYO_COMMAND_LEN + 4);\r
+ genre2 = bitsrevervse ((irmp_data_p->flags & ~IRSND_REPETITION_MASK) >> 4, 4);\r
\r
- xor_value = ((address & 0x000F) ^ ((address & 0x00F0) >> 4) ^ ((address & 0x0F00) >> 8) ^ ((address & 0xF000) >> 12)) & 0x0F;\r
+ xor_value = ((address & 0x000F) ^ ((address & 0x00F0) >> 4) ^ ((address & 0x0F00) >> 8) ^ ((address & 0xF000) >> 12)) & 0x0F;\r
\r
- irsnd_buffer[0] = (address & 0xFF00) >> 8; // AAAAAAAA\r
- irsnd_buffer[1] = (address & 0x00FF); // AAAAAAAA\r
- irsnd_buffer[2] = xor_value << 4 | (command & 0x000F); // XXXXCCCC\r
- irsnd_buffer[3] = (genre2 << 4) | (command & 0xF000) >> 12; // ggggCCCC\r
- irsnd_buffer[4] = (command & 0x0FF0) >> 4; // CCCCCCCC\r
+ irsnd_buffer[0] = (address & 0xFF00) >> 8; // AAAAAAAA\r
+ irsnd_buffer[1] = (address & 0x00FF); // AAAAAAAA\r
+ irsnd_buffer[2] = xor_value << 4 | (command & 0x000F); // XXXXCCCC\r
+ irsnd_buffer[3] = (genre2 << 4) | (command & 0xF000) >> 12; // ggggCCCC\r
+ irsnd_buffer[4] = (command & 0x0FF0) >> 4; // CCCCCCCC\r
\r
- xor_value = irsnd_buffer[2] ^ irsnd_buffer[3] ^ irsnd_buffer[4];\r
+ xor_value = irsnd_buffer[2] ^ irsnd_buffer[3] ^ irsnd_buffer[4];\r
\r
- irsnd_buffer[5] = xor_value;\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ irsnd_buffer[5] = xor_value;\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_PANASONIC_PROTOCOL == 1\r
- case IRMP_PANASONIC_PROTOCOL:\r
- {\r
- address = bitsrevervse (irmp_data_p->address, PANASONIC_ADDRESS_LEN);\r
- command = bitsrevervse (irmp_data_p->command, PANASONIC_COMMAND_LEN);\r
-\r
- irsnd_buffer[0] = 0x40; // 01000000\r
- irsnd_buffer[1] = 0x04; // 00000100\r
- irsnd_buffer[2] = 0x01; // 00000001\r
- irsnd_buffer[3] = (address & 0xFF00) >> 8; // AAAAAAAA\r
- irsnd_buffer[4] = (address & 0x00FF); // AAAAAAAA\r
- irsnd_buffer[5] = (command & 0xFF00) >> 8; // CCCCCCCC\r
- irsnd_buffer[6] = (command & 0x00FF); // CCCCCCCC\r
-\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ case IRMP_PANASONIC_PROTOCOL:\r
+ {\r
+ address = bitsrevervse (irmp_data_p->address, PANASONIC_ADDRESS_LEN);\r
+ command = bitsrevervse (irmp_data_p->command, PANASONIC_COMMAND_LEN);\r
+\r
+ irsnd_buffer[0] = 0x40; // 01000000\r
+ irsnd_buffer[1] = 0x04; // 00000100\r
+ irsnd_buffer[2] = 0x01; // 00000001\r
+ irsnd_buffer[3] = (address & 0xFF00) >> 8; // AAAAAAAA\r
+ irsnd_buffer[4] = (address & 0x00FF); // AAAAAAAA\r
+ irsnd_buffer[5] = (command & 0xFF00) >> 8; // CCCCCCCC\r
+ irsnd_buffer[6] = (command & 0x00FF); // CCCCCCCC\r
+\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_RECS80_PROTOCOL == 1\r
- case IRMP_RECS80_PROTOCOL:\r
- {\r
- toggle_bit_recs80 = toggle_bit_recs80 ? 0x00 : 0x40;\r
-\r
- irsnd_buffer[0] = 0x80 | toggle_bit_recs80 | ((irmp_data_p->address & 0x0007) << 3) |\r
- ((irmp_data_p->command & 0x0038) >> 3); // STAAACCC\r
- irsnd_buffer[1] = (irmp_data_p->command & 0x07) << 5; // CCC00000\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ case IRMP_RECS80_PROTOCOL:\r
+ {\r
+ toggle_bit_recs80 = toggle_bit_recs80 ? 0x00 : 0x40;\r
+\r
+ irsnd_buffer[0] = 0x80 | toggle_bit_recs80 | ((irmp_data_p->address & 0x0007) << 3) |\r
+ ((irmp_data_p->command & 0x0038) >> 3); // STAAACCC\r
+ irsnd_buffer[1] = (irmp_data_p->command & 0x07) << 5; // CCC00000\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_RECS80EXT_PROTOCOL == 1\r
- case IRMP_RECS80EXT_PROTOCOL:\r
- {\r
- toggle_bit_recs80ext = toggle_bit_recs80ext ? 0x00 : 0x40;\r
-\r
- irsnd_buffer[0] = 0x80 | toggle_bit_recs80ext | ((irmp_data_p->address & 0x000F) << 2) |\r
- ((irmp_data_p->command & 0x0030) >> 4); // STAAAACC\r
- irsnd_buffer[1] = (irmp_data_p->command & 0x0F) << 4; // CCCC0000\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ case IRMP_RECS80EXT_PROTOCOL:\r
+ {\r
+ toggle_bit_recs80ext = toggle_bit_recs80ext ? 0x00 : 0x40;\r
+\r
+ irsnd_buffer[0] = 0x80 | toggle_bit_recs80ext | ((irmp_data_p->address & 0x000F) << 2) |\r
+ ((irmp_data_p->command & 0x0030) >> 4); // STAAAACC\r
+ irsnd_buffer[1] = (irmp_data_p->command & 0x0F) << 4; // CCCC0000\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_RC5_PROTOCOL == 1\r
- case IRMP_RC5_PROTOCOL:\r
- {\r
- toggle_bit_rc5 = toggle_bit_rc5 ? 0x00 : 0x40;\r
-\r
- irsnd_buffer[0] = ((irmp_data_p->command & 0x40) ? 0x00 : 0x80) | toggle_bit_rc5 |\r
- ((irmp_data_p->address & 0x001F) << 1) | ((irmp_data_p->command & 0x20) >> 5); // CTAAAAAC\r
- irsnd_buffer[1] = (irmp_data_p->command & 0x1F) << 3; // CCCCC000\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ case IRMP_RC5_PROTOCOL:\r
+ {\r
+ toggle_bit_rc5 = toggle_bit_rc5 ? 0x00 : 0x40;\r
+\r
+ irsnd_buffer[0] = ((irmp_data_p->command & 0x40) ? 0x00 : 0x80) | toggle_bit_rc5 |\r
+ ((irmp_data_p->address & 0x001F) << 1) | ((irmp_data_p->command & 0x20) >> 5); // CTAAAAAC\r
+ irsnd_buffer[1] = (irmp_data_p->command & 0x1F) << 3; // CCCCC000\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_RC6_PROTOCOL == 1\r
- case IRMP_RC6_PROTOCOL:\r
- {\r
- toggle_bit_rc6 = toggle_bit_rc6 ? 0x00 : 0x08;\r
-\r
- irsnd_buffer[0] = 0x80 | toggle_bit_rc6 | ((irmp_data_p->address & 0x00E0) >> 5); // 1MMMTAAA, MMM = 000\r
- irsnd_buffer[1] = ((irmp_data_p->address & 0x001F) << 3) | ((irmp_data_p->command & 0xE0) >> 5); // AAAAACCC\r
- irsnd_buffer[2] = (irmp_data_p->command & 0x1F) << 3; // CCCCC\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ case IRMP_RC6_PROTOCOL:\r
+ {\r
+ toggle_bit_rc6 = toggle_bit_rc6 ? 0x00 : 0x08;\r
+\r
+ irsnd_buffer[0] = 0x80 | toggle_bit_rc6 | ((irmp_data_p->address & 0x00E0) >> 5); // 1MMMTAAA, MMM = 000\r
+ irsnd_buffer[1] = ((irmp_data_p->address & 0x001F) << 3) | ((irmp_data_p->command & 0xE0) >> 5); // AAAAACCC\r
+ irsnd_buffer[2] = (irmp_data_p->command & 0x1F) << 3; // CCCCC\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_RC6A_PROTOCOL == 1\r
- case IRMP_RC6A_PROTOCOL:\r
- {\r
- toggle_bit_rc6 = toggle_bit_rc6 ? 0x00 : 0x08;\r
-\r
- irsnd_buffer[0] = 0x80 | 0x60 | ((irmp_data_p->address & 0x3000) >> 12); // 1MMMT0AA, MMM = 110\r
- irsnd_buffer[1] = ((irmp_data_p->address & 0x0FFF) >> 4) ; // AAAAAAAA\r
- irsnd_buffer[2] = ((irmp_data_p->address & 0x000F) << 4) | ((irmp_data_p->command & 0xF000) >> 12) | toggle_bit_rc6; // AAAACCCC\r
- irsnd_buffer[3] = (irmp_data_p->command & 0x0FF0) >> 4; // CCCCCCCC\r
- irsnd_buffer[4] = (irmp_data_p->command & 0x000F) << 4; // CCCC\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ case IRMP_RC6A_PROTOCOL:\r
+ {\r
+ toggle_bit_rc6 = toggle_bit_rc6 ? 0x00 : 0x08;\r
+\r
+ irsnd_buffer[0] = 0x80 | 0x60 | ((irmp_data_p->address & 0x3000) >> 12); // 1MMMT0AA, MMM = 110\r
+ irsnd_buffer[1] = ((irmp_data_p->address & 0x0FFF) >> 4) ; // AAAAAAAA\r
+ irsnd_buffer[2] = ((irmp_data_p->address & 0x000F) << 4) | ((irmp_data_p->command & 0xF000) >> 12) | toggle_bit_rc6; // AAAACCCC\r
+ irsnd_buffer[3] = (irmp_data_p->command & 0x0FF0) >> 4; // CCCCCCCC\r
+ irsnd_buffer[4] = (irmp_data_p->command & 0x000F) << 4; // CCCC\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_DENON_PROTOCOL == 1\r
- case IRMP_DENON_PROTOCOL:\r
- {\r
- irsnd_buffer[0] = ((irmp_data_p->address & 0x1F) << 3) | ((irmp_data_p->command & 0x0380) >> 7); // AAAAACCC (1st frame)\r
- irsnd_buffer[1] = (irmp_data_p->command & 0x7F) << 1; // CCCCCCC\r
- irsnd_buffer[2] = ((irmp_data_p->address & 0x1F) << 3) | (((~irmp_data_p->command) & 0x0380) >> 7); // AAAAAccc (2nd frame)\r
- irsnd_buffer[3] = (~(irmp_data_p->command) & 0x7F) << 1; // ccccccc\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ case IRMP_DENON_PROTOCOL:\r
+ {\r
+ irsnd_buffer[0] = ((irmp_data_p->address & 0x1F) << 3) | ((irmp_data_p->command & 0x0380) >> 7); // AAAAACCC (1st frame)\r
+ irsnd_buffer[1] = (irmp_data_p->command & 0x7F) << 1; // CCCCCCC\r
+ irsnd_buffer[2] = ((irmp_data_p->address & 0x1F) << 3) | (((~irmp_data_p->command) & 0x0380) >> 7); // AAAAAccc (2nd frame)\r
+ irsnd_buffer[3] = (~(irmp_data_p->command) & 0x7F) << 1; // ccccccc\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_THOMSON_PROTOCOL == 1\r
- case IRMP_THOMSON_PROTOCOL:\r
- {\r
- toggle_bit_thomson = toggle_bit_thomson ? 0x00 : 0x08;\r
-\r
- irsnd_buffer[0] = ((irmp_data_p->address & 0x0F) << 4) | toggle_bit_thomson | ((irmp_data_p->command & 0x0070) >> 4); // AAAATCCC (1st frame)\r
- irsnd_buffer[1] = (irmp_data_p->command & 0x0F) << 4; // CCCC\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ case IRMP_THOMSON_PROTOCOL:\r
+ {\r
+ toggle_bit_thomson = toggle_bit_thomson ? 0x00 : 0x08;\r
+\r
+ irsnd_buffer[0] = ((irmp_data_p->address & 0x0F) << 4) | toggle_bit_thomson | ((irmp_data_p->command & 0x0070) >> 4); // AAAATCCC (1st frame)\r
+ irsnd_buffer[1] = (irmp_data_p->command & 0x0F) << 4; // CCCC\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_BOSE_PROTOCOL == 1\r
- case IRMP_BOSE_PROTOCOL:\r
- {\r
- command = bitsrevervse (irmp_data_p->command, BOSE_COMMAND_LEN);\r
-\r
- irsnd_buffer[0] = (command & 0xFF00) >> 8; // CCCCCCCC\r
- irsnd_buffer[1] = ~((command & 0xFF00) >> 8); // cccccccc\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ case IRMP_BOSE_PROTOCOL:\r
+ {\r
+ command = bitsrevervse (irmp_data_p->command, BOSE_COMMAND_LEN);\r
+\r
+ irsnd_buffer[0] = (command & 0xFF00) >> 8; // CCCCCCCC\r
+ irsnd_buffer[1] = ~((command & 0xFF00) >> 8); // cccccccc\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_NUBERT_PROTOCOL == 1\r
- case IRMP_NUBERT_PROTOCOL:\r
- {\r
- irsnd_buffer[0] = irmp_data_p->command >> 2; // CCCCCCCC\r
- irsnd_buffer[1] = (irmp_data_p->command & 0x0003) << 6; // CC000000\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ case IRMP_NUBERT_PROTOCOL:\r
+ {\r
+ irsnd_buffer[0] = irmp_data_p->command >> 2; // CCCCCCCC\r
+ irsnd_buffer[1] = (irmp_data_p->command & 0x0003) << 6; // CC000000\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_FAN_PROTOCOL == 1\r
- case IRMP_FAN_PROTOCOL:\r
- {\r
- irsnd_buffer[0] = irmp_data_p->command >> 3; // CCCCCCCC\r
- irsnd_buffer[1] = (irmp_data_p->command & 0x0007) << 5; // CCC00000\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ case IRMP_FAN_PROTOCOL:\r
+ {\r
+ irsnd_buffer[0] = irmp_data_p->command >> 3; // CCCCCCCC\r
+ irsnd_buffer[1] = (irmp_data_p->command & 0x0007) << 5; // CCC00000\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_SPEAKER_PROTOCOL == 1\r
- case IRMP_SPEAKER_PROTOCOL:\r
- {\r
- irsnd_buffer[0] = irmp_data_p->command >> 2; // CCCCCCCC\r
- irsnd_buffer[1] = (irmp_data_p->command & 0x0003) << 6; // CC000000\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ case IRMP_SPEAKER_PROTOCOL:\r
+ {\r
+ irsnd_buffer[0] = irmp_data_p->command >> 2; // CCCCCCCC\r
+ irsnd_buffer[1] = (irmp_data_p->command & 0x0003) << 6; // CC000000\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1\r
- case IRMP_BANG_OLUFSEN_PROTOCOL:\r
- {\r
- irsnd_buffer[0] = irmp_data_p->command >> 11; // SXSCCCCC\r
- irsnd_buffer[1] = irmp_data_p->command >> 3; // CCCCCCCC\r
- irsnd_buffer[2] = (irmp_data_p->command & 0x0007) << 5; // CCC00000\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ case IRMP_BANG_OLUFSEN_PROTOCOL:\r
+ {\r
+ irsnd_buffer[0] = irmp_data_p->command >> 11; // SXSCCCCC\r
+ irsnd_buffer[1] = irmp_data_p->command >> 3; // CCCCCCCC\r
+ irsnd_buffer[2] = (irmp_data_p->command & 0x0007) << 5; // CCC00000\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_GRUNDIG_PROTOCOL == 1\r
- case IRMP_GRUNDIG_PROTOCOL:\r
- {\r
- command = bitsrevervse (irmp_data_p->command, TELEFUNKEN_COMMAND_LEN);\r
+ case IRMP_GRUNDIG_PROTOCOL:\r
+ {\r
+ command = bitsrevervse (irmp_data_p->command, TELEFUNKEN_COMMAND_LEN);\r
\r
- irsnd_buffer[0] = 0xFF; // S1111111 (1st frame)\r
- irsnd_buffer[1] = 0xC0; // 11\r
- irsnd_buffer[2] = 0x80 | (command >> 2); // SCCCCCCC (2nd frame)\r
- irsnd_buffer[3] = (command << 6) & 0xC0; // CC\r
+ irsnd_buffer[0] = 0xFF; // S1111111 (1st frame)\r
+ irsnd_buffer[1] = 0xC0; // 11\r
+ irsnd_buffer[2] = 0x80 | (command >> 2); // SCCCCCCC (2nd frame)\r
+ irsnd_buffer[3] = (command << 6) & 0xC0; // CC\r
\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_TELEFUNKEN_PROTOCOL == 1\r
- case IRMP_TELEFUNKEN_PROTOCOL:\r
- {\r
- irsnd_buffer[0] = irmp_data_p->command >> 7; // CCCCCCCC\r
- irsnd_buffer[1] = (irmp_data_p->command << 1) & 0xff; // CCCCCCC\r
+ case IRMP_TELEFUNKEN_PROTOCOL:\r
+ {\r
+ irsnd_buffer[0] = irmp_data_p->command >> 7; // CCCCCCCC\r
+ irsnd_buffer[1] = (irmp_data_p->command << 1) & 0xff; // CCCCCCC\r
\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_IR60_PROTOCOL == 1\r
- case IRMP_IR60_PROTOCOL:\r
- {\r
- command = (bitsrevervse (0x7d, IR60_COMMAND_LEN) << 7) | bitsrevervse (irmp_data_p->command, IR60_COMMAND_LEN);\r
+ case IRMP_IR60_PROTOCOL:\r
+ {\r
+ command = (bitsrevervse (0x7d, IR60_COMMAND_LEN) << 7) | bitsrevervse (irmp_data_p->command, IR60_COMMAND_LEN);\r
#if 0\r
- irsnd_buffer[0] = command >> 6 | 0x01; // 1011111S (start instruction frame)\r
- irsnd_buffer[1] = (command & 0x7F) << 1; // CCCCCCC_ (2nd frame)\r
+ irsnd_buffer[0] = command >> 6 | 0x01; // 1011111S (start instruction frame)\r
+ irsnd_buffer[1] = (command & 0x7F) << 1; // CCCCCCC_ (2nd frame)\r
#else\r
- irsnd_buffer[0] = ((command & 0x7F) << 1) | 0x01; // CCCCCCCS (1st frame)\r
- irsnd_buffer[1] = command >> 6; // 1011111_ (start instruction frame)\r
+ irsnd_buffer[0] = ((command & 0x7F) << 1) | 0x01; // CCCCCCCS (1st frame)\r
+ irsnd_buffer[1] = command >> 6; // 1011111_ (start instruction frame)\r
#endif\r
\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_NOKIA_PROTOCOL == 1\r
- case IRMP_NOKIA_PROTOCOL:\r
- {\r
- address = bitsrevervse (irmp_data_p->address, NOKIA_ADDRESS_LEN);\r
- command = bitsrevervse (irmp_data_p->command, NOKIA_COMMAND_LEN);\r
-\r
- irsnd_buffer[0] = 0xBF; // S0111111 (1st + 3rd frame)\r
- irsnd_buffer[1] = 0xFF; // 11111111\r
- irsnd_buffer[2] = 0x80; // 1\r
- irsnd_buffer[3] = 0x80 | command >> 1; // SCCCCCCC (2nd frame)\r
- irsnd_buffer[4] = (command << 7) | (address >> 1); // CAAAAAAA\r
- irsnd_buffer[5] = (address << 7); // A\r
-\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ case IRMP_NOKIA_PROTOCOL:\r
+ {\r
+ address = bitsrevervse (irmp_data_p->address, NOKIA_ADDRESS_LEN);\r
+ command = bitsrevervse (irmp_data_p->command, NOKIA_COMMAND_LEN);\r
+\r
+ irsnd_buffer[0] = 0xBF; // S0111111 (1st + 3rd frame)\r
+ irsnd_buffer[1] = 0xFF; // 11111111\r
+ irsnd_buffer[2] = 0x80; // 1\r
+ irsnd_buffer[3] = 0x80 | command >> 1; // SCCCCCCC (2nd frame)\r
+ irsnd_buffer[4] = (command << 7) | (address >> 1); // CAAAAAAA\r
+ irsnd_buffer[5] = (address << 7); // A\r
+\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_SIEMENS_PROTOCOL == 1\r
- case IRMP_SIEMENS_PROTOCOL:\r
- {\r
- irsnd_buffer[0] = ((irmp_data_p->address & 0x07FF) >> 3); // AAAAAAAA\r
- irsnd_buffer[1] = ((irmp_data_p->address & 0x0007) << 5) | ((irmp_data_p->command >> 5) & 0x1F); // AAACCCCC\r
- irsnd_buffer[2] = ((irmp_data_p->command & 0x001F) << 3) | ((~irmp_data_p->command & 0x01) << 2); // CCCCCc\r
-\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ case IRMP_SIEMENS_PROTOCOL:\r
+ {\r
+ irsnd_buffer[0] = ((irmp_data_p->address & 0x07FF) >> 3); // AAAAAAAA\r
+ irsnd_buffer[1] = ((irmp_data_p->address & 0x0007) << 5) | ((irmp_data_p->command >> 5) & 0x1F); // AAACCCCC\r
+ irsnd_buffer[2] = ((irmp_data_p->command & 0x001F) << 3) | ((~irmp_data_p->command & 0x01) << 2); // CCCCCc\r
+\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_RUWIDO_PROTOCOL == 1\r
- case IRMP_RUWIDO_PROTOCOL:\r
- {\r
- irsnd_buffer[0] = ((irmp_data_p->address & 0x01FF) >> 1); // AAAAAAAA\r
- irsnd_buffer[1] = ((irmp_data_p->address & 0x0001) << 7) | ((irmp_data_p->command & 0x7F)); // ACCCCCCC\r
- irsnd_buffer[2] = ((~irmp_data_p->command & 0x01) << 7); // c\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ case IRMP_RUWIDO_PROTOCOL:\r
+ {\r
+ irsnd_buffer[0] = ((irmp_data_p->address & 0x01FF) >> 1); // AAAAAAAA\r
+ irsnd_buffer[1] = ((irmp_data_p->address & 0x0001) << 7) | ((irmp_data_p->command & 0x7F)); // ACCCCCCC\r
+ irsnd_buffer[2] = ((~irmp_data_p->command & 0x01) << 7); // c\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_FDC_PROTOCOL == 1\r
- case IRMP_FDC_PROTOCOL:\r
- {\r
- address = bitsrevervse (irmp_data_p->address, FDC_ADDRESS_LEN);\r
- command = bitsrevervse (irmp_data_p->command, FDC_COMMAND_LEN);\r
-\r
- irsnd_buffer[0] = (address & 0xFF); // AAAAAAAA\r
- irsnd_buffer[1] = 0; // 00000000\r
- irsnd_buffer[2] = 0; // 0000RRRR\r
- irsnd_buffer[3] = (command & 0xFF); // CCCCCCCC\r
- irsnd_buffer[4] = ~(command & 0xFF); // cccccccc\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ case IRMP_FDC_PROTOCOL:\r
+ {\r
+ address = bitsrevervse (irmp_data_p->address, FDC_ADDRESS_LEN);\r
+ command = bitsrevervse (irmp_data_p->command, FDC_COMMAND_LEN);\r
+\r
+ irsnd_buffer[0] = (address & 0xFF); // AAAAAAAA\r
+ irsnd_buffer[1] = 0; // 00000000\r
+ irsnd_buffer[2] = 0; // 0000RRRR\r
+ irsnd_buffer[3] = (command & 0xFF); // CCCCCCCC\r
+ irsnd_buffer[4] = ~(command & 0xFF); // cccccccc\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_RCCAR_PROTOCOL == 1\r
- case IRMP_RCCAR_PROTOCOL:\r
- {\r
- address = bitsrevervse (irmp_data_p->address, 2); // A0 A1\r
- command = bitsrevervse (irmp_data_p->command, RCCAR_COMMAND_LEN - 2); // D0 D1 D2 D3 D4 D5 D6 D7 C0 C1 V\r
-\r
- irsnd_buffer[0] = ((command & 0x06) << 5) | ((address & 0x0003) << 4) | ((command & 0x0780) >> 7); // C0 C1 A0 A1 D0 D1 D2 D3\r
- irsnd_buffer[1] = ((command & 0x78) << 1) | ((command & 0x0001) << 3); // D4 D5 D6 D7 V 0 0 0\r
- \r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ case IRMP_RCCAR_PROTOCOL:\r
+ {\r
+ address = bitsrevervse (irmp_data_p->address, 2); // A0 A1\r
+ command = bitsrevervse (irmp_data_p->command, RCCAR_COMMAND_LEN - 2); // D0 D1 D2 D3 D4 D5 D6 D7 C0 C1 V\r
+\r
+ irsnd_buffer[0] = ((command & 0x06) << 5) | ((address & 0x0003) << 4) | ((command & 0x0780) >> 7); // C0 C1 A0 A1 D0 D1 D2 D3\r
+ irsnd_buffer[1] = ((command & 0x78) << 1) | ((command & 0x0001) << 3); // D4 D5 D6 D7 V 0 0 0\r
+ \r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_JVC_PROTOCOL == 1\r
- case IRMP_JVC_PROTOCOL:\r
- {\r
- address = bitsrevervse (irmp_data_p->address, JVC_ADDRESS_LEN);\r
- command = bitsrevervse (irmp_data_p->command, JVC_COMMAND_LEN);\r
+ case IRMP_JVC_PROTOCOL:\r
+ {\r
+ address = bitsrevervse (irmp_data_p->address, JVC_ADDRESS_LEN);\r
+ command = bitsrevervse (irmp_data_p->command, JVC_COMMAND_LEN);\r
\r
- irsnd_buffer[0] = ((address & 0x000F) << 4) | (command & 0x0F00) >> 8; // AAAACCCC\r
- irsnd_buffer[1] = (command & 0x00FF); // CCCCCCCC\r
+ irsnd_buffer[0] = ((address & 0x000F) << 4) | (command & 0x0F00) >> 8; // AAAACCCC\r
+ irsnd_buffer[1] = (command & 0x00FF); // CCCCCCCC\r
\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_NIKON_PROTOCOL == 1\r
- case IRMP_NIKON_PROTOCOL:\r
- {\r
- irsnd_buffer[0] = (irmp_data_p->command & 0x0003) << 6; // CC\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ case IRMP_NIKON_PROTOCOL:\r
+ {\r
+ irsnd_buffer[0] = (irmp_data_p->command & 0x0003) << 6; // CC\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_LEGO_PROTOCOL == 1\r
- case IRMP_LEGO_PROTOCOL:\r
- {\r
- uint8_t crc = 0x0F ^ ((irmp_data_p->command & 0x0F00) >> 8) ^ ((irmp_data_p->command & 0x00F0) >> 4) ^ (irmp_data_p->command & 0x000F);\r
-\r
- irsnd_buffer[0] = (irmp_data_p->command & 0x0FF0) >> 4; // CCCCCCCC\r
- irsnd_buffer[1] = ((irmp_data_p->command & 0x000F) << 4) | crc; // CCCCcccc\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ case IRMP_LEGO_PROTOCOL:\r
+ {\r
+ uint8_t crc = 0x0F ^ ((irmp_data_p->command & 0x0F00) >> 8) ^ ((irmp_data_p->command & 0x00F0) >> 4) ^ (irmp_data_p->command & 0x000F);\r
+\r
+ irsnd_buffer[0] = (irmp_data_p->command & 0x0FF0) >> 4; // CCCCCCCC\r
+ irsnd_buffer[1] = ((irmp_data_p->command & 0x000F) << 4) | crc; // CCCCcccc\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_A1TVBOX_PROTOCOL == 1\r
- case IRMP_A1TVBOX_PROTOCOL:\r
- {\r
- irsnd_buffer[0] = 0x80 | (irmp_data_p->address >> 2); // 10AAAAAA\r
- irsnd_buffer[1] = (irmp_data_p->address << 6) | (irmp_data_p->command >> 2); // AACCCCCC\r
- irsnd_buffer[2] = (irmp_data_p->command << 6); // CC\r
-\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ case IRMP_A1TVBOX_PROTOCOL:\r
+ {\r
+ irsnd_buffer[0] = 0x80 | (irmp_data_p->address >> 2); // 10AAAAAA\r
+ irsnd_buffer[1] = (irmp_data_p->address << 6) | (irmp_data_p->command >> 2); // AACCCCCC\r
+ irsnd_buffer[2] = (irmp_data_p->command << 6); // CC\r
+\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_ROOMBA_PROTOCOL == 1\r
- case IRMP_ROOMBA_PROTOCOL:\r
- {\r
- irsnd_buffer[0] = (irmp_data_p->command & 0x7F) << 1; // CCCCCCC.\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ case IRMP_ROOMBA_PROTOCOL:\r
+ {\r
+ irsnd_buffer[0] = (irmp_data_p->command & 0x7F) << 1; // CCCCCCC.\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_PENTAX_PROTOCOL == 1\r
- case IRMP_PENTAX_PROTOCOL:\r
- {\r
- irsnd_buffer[0] = (irmp_data_p->command & 0x3F) << 2; // CCCCCC..\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
+ case IRMP_PENTAX_PROTOCOL:\r
+ {\r
+ irsnd_buffer[0] = (irmp_data_p->command & 0x3F) << 2; // CCCCCC..\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_ACP24_PROTOCOL == 1\r
# define ACP_SET_BIT(acp24_bitno, c, irmp_bitno) \\r
- do \\r
- { \\r
- if ((c) & (1<<(irmp_bitno))) \\r
- { \\r
- irsnd_buffer[((acp24_bitno)>>3)] |= 1 << (((7 - (acp24_bitno)) & 0x07)); \\r
- } \\r
- } while (0)\r
-\r
- case IRMP_ACP24_PROTOCOL:\r
- {\r
- uint16_t cmd = irmp_data_p->command;\r
- uint8_t i;\r
-\r
- address = bitsrevervse (irmp_data_p->address, ACP24_ADDRESS_LEN);\r
-\r
- for (i = 0; i < 8; i++)\r
- {\r
- irsnd_buffer[i] = 0x00; // CCCCCCCC\r
- }\r
-\r
- // ACP24-Frame:\r
- // 1 2 3 4 5 6\r
- // 0123456789012345678901234567890123456789012345678901234567890123456789\r
- // N VVMMM ? ??? t vmA x y TTTT\r
- // \r
- // irmp_data_p->command:\r
- // \r
- // 5432109876543210\r
- // NAVVvMMMmtxyTTTT\r
-\r
- ACP_SET_BIT( 0, cmd, 15);\r
- ACP_SET_BIT(24, cmd, 14);\r
- ACP_SET_BIT( 2, cmd, 13);\r
- ACP_SET_BIT( 3, cmd, 12);\r
- ACP_SET_BIT(22, cmd, 11);\r
- ACP_SET_BIT( 4, cmd, 10);\r
- ACP_SET_BIT( 5, cmd, 9);\r
- ACP_SET_BIT( 6, cmd, 8);\r
- ACP_SET_BIT(23, cmd, 7);\r
- ACP_SET_BIT(20, cmd, 6);\r
- ACP_SET_BIT(26, cmd, 5);\r
- ACP_SET_BIT(44, cmd, 4);\r
- ACP_SET_BIT(66, cmd, 3);\r
- ACP_SET_BIT(67, cmd, 2);\r
- ACP_SET_BIT(68, cmd, 1);\r
- ACP_SET_BIT(69, cmd, 0);\r
-\r
- irsnd_busy = TRUE;\r
- break;\r
- }\r
-#endif\r
-\r
- default:\r
- {\r
- break;\r
- }\r
+ do \\r
+ { \\r
+ if ((c) & (1<<(irmp_bitno))) \\r
+ { \\r
+ irsnd_buffer[((acp24_bitno)>>3)] |= 1 << (((7 - (acp24_bitno)) & 0x07)); \\r
+ } \\r
+ } while (0)\r
+\r
+ case IRMP_ACP24_PROTOCOL:\r
+ {\r
+ uint16_t cmd = irmp_data_p->command;\r
+ uint8_t i;\r
+\r
+ address = bitsrevervse (irmp_data_p->address, ACP24_ADDRESS_LEN);\r
+\r
+ for (i = 0; i < 8; i++)\r
+ {\r
+ irsnd_buffer[i] = 0x00; // CCCCCCCC\r
+ }\r
+\r
+ // ACP24-Frame:\r
+ // 1 2 3 4 5 6\r
+ // 0123456789012345678901234567890123456789012345678901234567890123456789\r
+ // N VVMMM ? ??? t vmA x y TTTT\r
+ // \r
+ // irmp_data_p->command:\r
+ // \r
+ // 5432109876543210\r
+ // NAVVvMMMmtxyTTTT\r
+\r
+ ACP_SET_BIT( 0, cmd, 15);\r
+ ACP_SET_BIT(24, cmd, 14);\r
+ ACP_SET_BIT( 2, cmd, 13);\r
+ ACP_SET_BIT( 3, cmd, 12);\r
+ ACP_SET_BIT(22, cmd, 11);\r
+ ACP_SET_BIT( 4, cmd, 10);\r
+ ACP_SET_BIT( 5, cmd, 9);\r
+ ACP_SET_BIT( 6, cmd, 8);\r
+ ACP_SET_BIT(23, cmd, 7);\r
+ ACP_SET_BIT(20, cmd, 6);\r
+ ACP_SET_BIT(26, cmd, 5);\r
+ ACP_SET_BIT(44, cmd, 4);\r
+ ACP_SET_BIT(66, cmd, 3);\r
+ ACP_SET_BIT(67, cmd, 2);\r
+ ACP_SET_BIT(68, cmd, 1);\r
+ ACP_SET_BIT(69, cmd, 0);\r
+\r
+ irsnd_busy = TRUE;\r
+ break;\r
+ }\r
+#endif\r
+\r
+ default:\r
+ {\r
+ break;\r
+ }\r
}\r
\r
return irsnd_busy;\r
\r
if (irsnd_busy)\r
{\r
- if (current_bit == 0xFF && new_frame) // start of transmission...\r
- {\r
- if (auto_repetition_counter > 0)\r
- {\r
- auto_repetition_pause_counter++;\r
+ if (current_bit == 0xFF && new_frame) // start of transmission...\r
+ {\r
+ if (auto_repetition_counter > 0)\r
+ {\r
+ auto_repetition_pause_counter++;\r
\r
- if (auto_repetition_pause_counter >= auto_repetition_pause_len)\r
- {\r
- auto_repetition_pause_counter = 0;\r
+ if (auto_repetition_pause_counter >= auto_repetition_pause_len)\r
+ {\r
+ auto_repetition_pause_counter = 0;\r
\r
#if IRSND_SUPPORT_DENON_PROTOCOL == 1\r
- if (irsnd_protocol == IRMP_DENON_PROTOCOL) // n'th denon frame\r
- {\r
- current_bit = 16;\r
- complete_data_len = 2 * DENON_COMPLETE_DATA_LEN + 1;\r
- }\r
- else\r
+ if (irsnd_protocol == IRMP_DENON_PROTOCOL) // n'th denon frame\r
+ {\r
+ current_bit = 16;\r
+ complete_data_len = 2 * DENON_COMPLETE_DATA_LEN + 1;\r
+ }\r
+ else\r
#endif\r
#if IRSND_SUPPORT_GRUNDIG_PROTOCOL == 1\r
- if (irsnd_protocol == IRMP_GRUNDIG_PROTOCOL) // n'th grundig frame\r
- {\r
- current_bit = 15;\r
- complete_data_len = 16 + GRUNDIG_COMPLETE_DATA_LEN;\r
- }\r
- else\r
+ if (irsnd_protocol == IRMP_GRUNDIG_PROTOCOL) // n'th grundig frame\r
+ {\r
+ current_bit = 15;\r
+ complete_data_len = 16 + GRUNDIG_COMPLETE_DATA_LEN;\r
+ }\r
+ else\r
#endif\r
#if IRSND_SUPPORT_IR60_PROTOCOL == 1\r
- if (irsnd_protocol == IRMP_IR60_PROTOCOL) // n'th IR60 frame\r
- {\r
- current_bit = 7;\r
- complete_data_len = 2 * IR60_COMPLETE_DATA_LEN + 1;\r
- }\r
- else\r
+ if (irsnd_protocol == IRMP_IR60_PROTOCOL) // n'th IR60 frame\r
+ {\r
+ current_bit = 7;\r
+ complete_data_len = 2 * IR60_COMPLETE_DATA_LEN + 1;\r
+ }\r
+ else\r
#endif\r
#if IRSND_SUPPORT_NOKIA_PROTOCOL == 1\r
- if (irsnd_protocol == IRMP_NOKIA_PROTOCOL) // n'th nokia frame\r
- {\r
- if (auto_repetition_counter + 1 < n_auto_repetitions)\r
- {\r
- current_bit = 23;\r
- complete_data_len = 24 + NOKIA_COMPLETE_DATA_LEN;\r
- }\r
- else // nokia stop frame\r
- {\r
- current_bit = 0xFF;\r
- complete_data_len = NOKIA_COMPLETE_DATA_LEN;\r
- }\r
- }\r
- else\r
-#endif\r
- {\r
- ;\r
- }\r
- }\r
- else\r
- {\r
+ if (irsnd_protocol == IRMP_NOKIA_PROTOCOL) // n'th nokia frame\r
+ {\r
+ if (auto_repetition_counter + 1 < n_auto_repetitions)\r
+ {\r
+ current_bit = 23;\r
+ complete_data_len = 24 + NOKIA_COMPLETE_DATA_LEN;\r
+ }\r
+ else // nokia stop frame\r
+ {\r
+ current_bit = 0xFF;\r
+ complete_data_len = NOKIA_COMPLETE_DATA_LEN;\r
+ }\r
+ }\r
+ else\r
+#endif\r
+ {\r
+ ;\r
+ }\r
+ }\r
+ else\r
+ {\r
#ifdef ANALYZE\r
- if (irsnd_is_on)\r
- {\r
- putchar ('0');\r
- }\r
- else\r
- {\r
- putchar ('1');\r
- }\r
-#endif\r
- return irsnd_busy;\r
- }\r
- }\r
- else if (packet_repeat_pause_counter < repeat_frame_pause_len)\r
- {\r
- packet_repeat_pause_counter++;\r
+ if (irsnd_is_on)\r
+ {\r
+ putchar ('0');\r
+ }\r
+ else\r
+ {\r
+ putchar ('1');\r
+ }\r
+#endif\r
+ return irsnd_busy;\r
+ }\r
+ }\r
+ else if (packet_repeat_pause_counter < repeat_frame_pause_len)\r
+ {\r
+ packet_repeat_pause_counter++;\r
#ifdef ANALYZE\r
- if (irsnd_is_on)\r
- {\r
- putchar ('0');\r
- }\r
- else\r
- {\r
- putchar ('1');\r
- }\r
-#endif\r
- return irsnd_busy;\r
- }\r
- else\r
- {\r
- if (send_trailer)\r
- {\r
- irsnd_busy = FALSE;\r
- send_trailer = FALSE;\r
- return irsnd_busy;\r
- }\r
- \r
- n_repeat_frames = irsnd_repeat;\r
-\r
- if (n_repeat_frames == IRSND_ENDLESS_REPETITION)\r
- {\r
- n_repeat_frames = 255;\r
- }\r
-\r
- packet_repeat_pause_counter = 0;\r
- pulse_counter = 0;\r
- pause_counter = 0;\r
-\r
- switch (irsnd_protocol)\r
- {\r
+ if (irsnd_is_on)\r
+ {\r
+ putchar ('0');\r
+ }\r
+ else\r
+ {\r
+ putchar ('1');\r
+ }\r
+#endif\r
+ return irsnd_busy;\r
+ }\r
+ else\r
+ {\r
+ if (send_trailer)\r
+ {\r
+ irsnd_busy = FALSE;\r
+ send_trailer = FALSE;\r
+ return irsnd_busy;\r
+ }\r
+ \r
+ n_repeat_frames = irsnd_repeat;\r
+\r
+ if (n_repeat_frames == IRSND_ENDLESS_REPETITION)\r
+ {\r
+ n_repeat_frames = 255;\r
+ }\r
+\r
+ packet_repeat_pause_counter = 0;\r
+ pulse_counter = 0;\r
+ pause_counter = 0;\r
+\r
+ switch (irsnd_protocol)\r
+ {\r
#if IRSND_SUPPORT_SIRCS_PROTOCOL == 1\r
- case IRMP_SIRCS_PROTOCOL:\r
- {\r
- startbit_pulse_len = SIRCS_START_BIT_PULSE_LEN;\r
- startbit_pause_len = SIRCS_START_BIT_PAUSE_LEN - 1;\r
- pulse_1_len = SIRCS_1_PULSE_LEN;\r
- pause_1_len = SIRCS_PAUSE_LEN - 1;\r
- pulse_0_len = SIRCS_0_PULSE_LEN;\r
- pause_0_len = SIRCS_PAUSE_LEN - 1;\r
- has_stop_bit = SIRCS_STOP_BIT;\r
- complete_data_len = SIRCS_MINIMUM_DATA_LEN + sircs_additional_bitlen;\r
- n_auto_repetitions = (repeat_counter == 0) ? SIRCS_FRAMES : 1; // 3 frames auto repetition if first frame\r
- auto_repetition_pause_len = SIRCS_AUTO_REPETITION_PAUSE_LEN; // 25ms pause\r
- repeat_frame_pause_len = SIRCS_FRAME_REPEAT_PAUSE_LEN;\r
- irsnd_set_freq (IRSND_FREQ_40_KHZ);\r
- break;\r
- }\r
+ case IRMP_SIRCS_PROTOCOL:\r
+ {\r
+ startbit_pulse_len = SIRCS_START_BIT_PULSE_LEN;\r
+ startbit_pause_len = SIRCS_START_BIT_PAUSE_LEN - 1;\r
+ pulse_1_len = SIRCS_1_PULSE_LEN;\r
+ pause_1_len = SIRCS_PAUSE_LEN - 1;\r
+ pulse_0_len = SIRCS_0_PULSE_LEN;\r
+ pause_0_len = SIRCS_PAUSE_LEN - 1;\r
+ has_stop_bit = SIRCS_STOP_BIT;\r
+ complete_data_len = SIRCS_MINIMUM_DATA_LEN + sircs_additional_bitlen;\r
+ n_auto_repetitions = (repeat_counter == 0) ? SIRCS_FRAMES : 1; // 3 frames auto repetition if first frame\r
+ auto_repetition_pause_len = SIRCS_AUTO_REPETITION_PAUSE_LEN; // 25ms pause\r
+ repeat_frame_pause_len = SIRCS_FRAME_REPEAT_PAUSE_LEN;\r
+ irsnd_set_freq (IRSND_FREQ_40_KHZ);\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_NEC_PROTOCOL == 1\r
- case IRMP_NEC_PROTOCOL:\r
- {\r
- startbit_pulse_len = NEC_START_BIT_PULSE_LEN;\r
-\r
- if (repeat_counter > 0)\r
- {\r
- startbit_pause_len = NEC_REPEAT_START_BIT_PAUSE_LEN - 1;\r
- complete_data_len = 0;\r
- }\r
- else\r
- {\r
- startbit_pause_len = NEC_START_BIT_PAUSE_LEN - 1;\r
- complete_data_len = NEC_COMPLETE_DATA_LEN;\r
- }\r
-\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
- 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
+ case IRMP_NEC_PROTOCOL:\r
+ {\r
+ startbit_pulse_len = NEC_START_BIT_PULSE_LEN;\r
+\r
+ if (repeat_counter > 0)\r
+ {\r
+ startbit_pause_len = NEC_REPEAT_START_BIT_PAUSE_LEN - 1;\r
+ complete_data_len = 0;\r
+ }\r
+ else\r
+ {\r
+ startbit_pause_len = NEC_START_BIT_PAUSE_LEN - 1;\r
+ complete_data_len = NEC_COMPLETE_DATA_LEN;\r
+ }\r
+\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
+ 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_NEC16_PROTOCOL == 1\r
- case IRMP_NEC16_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 = NEC16_COMPLETE_DATA_LEN + 1; // 1 more: sync bit\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
+ case IRMP_NEC16_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 = NEC16_COMPLETE_DATA_LEN + 1; // 1 more: sync bit\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_NEC42_PROTOCOL == 1\r
- case IRMP_NEC42_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 = NEC42_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
+ case IRMP_NEC42_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 = NEC42_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_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
+ 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
- startbit_pulse_len = SAMSUNG_START_BIT_PULSE_LEN;\r
- startbit_pause_len = SAMSUNG_START_BIT_PAUSE_LEN - 1;\r
- pulse_1_len = SAMSUNG_PULSE_LEN;\r
- pause_1_len = SAMSUNG_1_PAUSE_LEN - 1;\r
- pulse_0_len = SAMSUNG_PULSE_LEN;\r
- pause_0_len = SAMSUNG_0_PAUSE_LEN - 1;\r
- has_stop_bit = SAMSUNG_STOP_BIT;\r
- complete_data_len = SAMSUNG_COMPLETE_DATA_LEN;\r
- n_auto_repetitions = 1; // 1 frame\r
- auto_repetition_pause_len = 0;\r
- repeat_frame_pause_len = SAMSUNG_FRAME_REPEAT_PAUSE_LEN;\r
- irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
- break;\r
- }\r
-\r
- case IRMP_SAMSUNG32_PROTOCOL:\r
- {\r
- startbit_pulse_len = SAMSUNG_START_BIT_PULSE_LEN;\r
- startbit_pause_len = SAMSUNG_START_BIT_PAUSE_LEN - 1;\r
- pulse_1_len = SAMSUNG_PULSE_LEN;\r
- pause_1_len = SAMSUNG_1_PAUSE_LEN - 1;\r
- pulse_0_len = SAMSUNG_PULSE_LEN;\r
- pause_0_len = SAMSUNG_0_PAUSE_LEN - 1;\r
- has_stop_bit = SAMSUNG_STOP_BIT;\r
- complete_data_len = SAMSUNG32_COMPLETE_DATA_LEN;\r
- n_auto_repetitions = SAMSUNG32_FRAMES; // 1 frame\r
- auto_repetition_pause_len = SAMSUNG32_AUTO_REPETITION_PAUSE_LEN; // 47 ms pause\r
- repeat_frame_pause_len = SAMSUNG32_FRAME_REPEAT_PAUSE_LEN;\r
- irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
- break;\r
- }\r
+ case IRMP_SAMSUNG_PROTOCOL:\r
+ {\r
+ startbit_pulse_len = SAMSUNG_START_BIT_PULSE_LEN;\r
+ startbit_pause_len = SAMSUNG_START_BIT_PAUSE_LEN - 1;\r
+ pulse_1_len = SAMSUNG_PULSE_LEN;\r
+ pause_1_len = SAMSUNG_1_PAUSE_LEN - 1;\r
+ pulse_0_len = SAMSUNG_PULSE_LEN;\r
+ pause_0_len = SAMSUNG_0_PAUSE_LEN - 1;\r
+ has_stop_bit = SAMSUNG_STOP_BIT;\r
+ complete_data_len = SAMSUNG_COMPLETE_DATA_LEN;\r
+ n_auto_repetitions = 1; // 1 frame\r
+ auto_repetition_pause_len = 0;\r
+ repeat_frame_pause_len = SAMSUNG_FRAME_REPEAT_PAUSE_LEN;\r
+ irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
+ break;\r
+ }\r
+\r
+ case IRMP_SAMSUNG32_PROTOCOL:\r
+ {\r
+ startbit_pulse_len = SAMSUNG_START_BIT_PULSE_LEN;\r
+ startbit_pause_len = SAMSUNG_START_BIT_PAUSE_LEN - 1;\r
+ pulse_1_len = SAMSUNG_PULSE_LEN;\r
+ pause_1_len = SAMSUNG_1_PAUSE_LEN - 1;\r
+ pulse_0_len = SAMSUNG_PULSE_LEN;\r
+ pause_0_len = SAMSUNG_0_PAUSE_LEN - 1;\r
+ has_stop_bit = SAMSUNG_STOP_BIT;\r
+ complete_data_len = SAMSUNG32_COMPLETE_DATA_LEN;\r
+ n_auto_repetitions = SAMSUNG32_FRAMES; // 1 frame\r
+ auto_repetition_pause_len = SAMSUNG32_AUTO_REPETITION_PAUSE_LEN; // 47 ms pause\r
+ repeat_frame_pause_len = SAMSUNG32_FRAME_REPEAT_PAUSE_LEN;\r
+ irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_SAMSUNG48_PROTOCOL == 1\r
- case IRMP_SAMSUNG48_PROTOCOL:\r
- {\r
- startbit_pulse_len = SAMSUNG_START_BIT_PULSE_LEN;\r
- startbit_pause_len = SAMSUNG_START_BIT_PAUSE_LEN - 1;\r
- pulse_1_len = SAMSUNG_PULSE_LEN;\r
- pause_1_len = SAMSUNG_1_PAUSE_LEN - 1;\r
- pulse_0_len = SAMSUNG_PULSE_LEN;\r
- pause_0_len = SAMSUNG_0_PAUSE_LEN - 1;\r
- has_stop_bit = SAMSUNG_STOP_BIT;\r
- complete_data_len = SAMSUNG48_COMPLETE_DATA_LEN;\r
- n_auto_repetitions = SAMSUNG48_FRAMES; // 1 frame\r
- auto_repetition_pause_len = SAMSUNG48_AUTO_REPETITION_PAUSE_LEN; // 47 ms pause\r
- repeat_frame_pause_len = SAMSUNG48_FRAME_REPEAT_PAUSE_LEN;\r
- irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
- break;\r
- }\r
+ case IRMP_SAMSUNG48_PROTOCOL:\r
+ {\r
+ startbit_pulse_len = SAMSUNG_START_BIT_PULSE_LEN;\r
+ startbit_pause_len = SAMSUNG_START_BIT_PAUSE_LEN - 1;\r
+ pulse_1_len = SAMSUNG_PULSE_LEN;\r
+ pause_1_len = SAMSUNG_1_PAUSE_LEN - 1;\r
+ pulse_0_len = SAMSUNG_PULSE_LEN;\r
+ pause_0_len = SAMSUNG_0_PAUSE_LEN - 1;\r
+ has_stop_bit = SAMSUNG_STOP_BIT;\r
+ complete_data_len = SAMSUNG48_COMPLETE_DATA_LEN;\r
+ n_auto_repetitions = SAMSUNG48_FRAMES; // 1 frame\r
+ auto_repetition_pause_len = SAMSUNG48_AUTO_REPETITION_PAUSE_LEN; // 47 ms pause\r
+ repeat_frame_pause_len = SAMSUNG48_FRAME_REPEAT_PAUSE_LEN;\r
+ irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_MATSUSHITA_PROTOCOL == 1\r
- case IRMP_MATSUSHITA_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 = MATSUSHITA_COMPLETE_DATA_LEN;\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
+ case IRMP_MATSUSHITA_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 = MATSUSHITA_COMPLETE_DATA_LEN;\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_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
+ 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
- startbit_pulse_len = KASEIKYO_START_BIT_PULSE_LEN;\r
- startbit_pause_len = KASEIKYO_START_BIT_PAUSE_LEN - 1;\r
- pulse_1_len = KASEIKYO_PULSE_LEN;\r
- pause_1_len = KASEIKYO_1_PAUSE_LEN - 1;\r
- pulse_0_len = KASEIKYO_PULSE_LEN;\r
- pause_0_len = KASEIKYO_0_PAUSE_LEN - 1;\r
- has_stop_bit = KASEIKYO_STOP_BIT;\r
- complete_data_len = KASEIKYO_COMPLETE_DATA_LEN;\r
- n_auto_repetitions = (repeat_counter == 0) ? KASEIKYO_FRAMES : 1; // 2 frames auto repetition if first frame\r
- auto_repetition_pause_len = KASEIKYO_AUTO_REPETITION_PAUSE_LEN; // 75 ms pause\r
- repeat_frame_pause_len = KASEIKYO_FRAME_REPEAT_PAUSE_LEN;\r
- irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
- break;\r
- }\r
+ case IRMP_KASEIKYO_PROTOCOL:\r
+ {\r
+ startbit_pulse_len = KASEIKYO_START_BIT_PULSE_LEN;\r
+ startbit_pause_len = KASEIKYO_START_BIT_PAUSE_LEN - 1;\r
+ pulse_1_len = KASEIKYO_PULSE_LEN;\r
+ pause_1_len = KASEIKYO_1_PAUSE_LEN - 1;\r
+ pulse_0_len = KASEIKYO_PULSE_LEN;\r
+ pause_0_len = KASEIKYO_0_PAUSE_LEN - 1;\r
+ has_stop_bit = KASEIKYO_STOP_BIT;\r
+ complete_data_len = KASEIKYO_COMPLETE_DATA_LEN;\r
+ n_auto_repetitions = (repeat_counter == 0) ? KASEIKYO_FRAMES : 1; // 2 frames auto repetition if first frame\r
+ auto_repetition_pause_len = KASEIKYO_AUTO_REPETITION_PAUSE_LEN; // 75 ms pause\r
+ repeat_frame_pause_len = KASEIKYO_FRAME_REPEAT_PAUSE_LEN;\r
+ irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_PANASONIC_PROTOCOL == 1\r
- case IRMP_PANASONIC_PROTOCOL:\r
- {\r
- startbit_pulse_len = PANASONIC_START_BIT_PULSE_LEN;\r
- startbit_pause_len = PANASONIC_START_BIT_PAUSE_LEN - 1;\r
- pulse_1_len = PANASONIC_PULSE_LEN;\r
- pause_1_len = PANASONIC_1_PAUSE_LEN - 1;\r
- pulse_0_len = PANASONIC_PULSE_LEN;\r
- pause_0_len = PANASONIC_0_PAUSE_LEN - 1;\r
- has_stop_bit = PANASONIC_STOP_BIT;\r
- complete_data_len = PANASONIC_COMPLETE_DATA_LEN;\r
- n_auto_repetitions = PANASONIC_FRAMES; // 1 frame\r
- auto_repetition_pause_len = PANASONIC_AUTO_REPETITION_PAUSE_LEN; // 40 ms pause\r
- repeat_frame_pause_len = PANASONIC_FRAME_REPEAT_PAUSE_LEN;\r
- irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
- break;\r
- }\r
+ case IRMP_PANASONIC_PROTOCOL:\r
+ {\r
+ startbit_pulse_len = PANASONIC_START_BIT_PULSE_LEN;\r
+ startbit_pause_len = PANASONIC_START_BIT_PAUSE_LEN - 1;\r
+ pulse_1_len = PANASONIC_PULSE_LEN;\r
+ pause_1_len = PANASONIC_1_PAUSE_LEN - 1;\r
+ pulse_0_len = PANASONIC_PULSE_LEN;\r
+ pause_0_len = PANASONIC_0_PAUSE_LEN - 1;\r
+ has_stop_bit = PANASONIC_STOP_BIT;\r
+ complete_data_len = PANASONIC_COMPLETE_DATA_LEN;\r
+ n_auto_repetitions = PANASONIC_FRAMES; // 1 frame\r
+ auto_repetition_pause_len = PANASONIC_AUTO_REPETITION_PAUSE_LEN; // 40 ms pause\r
+ repeat_frame_pause_len = PANASONIC_FRAME_REPEAT_PAUSE_LEN;\r
+ irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_RECS80_PROTOCOL == 1\r
- case IRMP_RECS80_PROTOCOL:\r
- {\r
- startbit_pulse_len = RECS80_START_BIT_PULSE_LEN;\r
- startbit_pause_len = RECS80_START_BIT_PAUSE_LEN - 1;\r
- pulse_1_len = RECS80_PULSE_LEN;\r
- pause_1_len = RECS80_1_PAUSE_LEN - 1;\r
- pulse_0_len = RECS80_PULSE_LEN;\r
- pause_0_len = RECS80_0_PAUSE_LEN - 1;\r
- has_stop_bit = RECS80_STOP_BIT;\r
- complete_data_len = RECS80_COMPLETE_DATA_LEN;\r
- n_auto_repetitions = 1; // 1 frame\r
- auto_repetition_pause_len = 0;\r
- repeat_frame_pause_len = RECS80_FRAME_REPEAT_PAUSE_LEN;\r
- irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
- break;\r
- }\r
+ case IRMP_RECS80_PROTOCOL:\r
+ {\r
+ startbit_pulse_len = RECS80_START_BIT_PULSE_LEN;\r
+ startbit_pause_len = RECS80_START_BIT_PAUSE_LEN - 1;\r
+ pulse_1_len = RECS80_PULSE_LEN;\r
+ pause_1_len = RECS80_1_PAUSE_LEN - 1;\r
+ pulse_0_len = RECS80_PULSE_LEN;\r
+ pause_0_len = RECS80_0_PAUSE_LEN - 1;\r
+ has_stop_bit = RECS80_STOP_BIT;\r
+ complete_data_len = RECS80_COMPLETE_DATA_LEN;\r
+ n_auto_repetitions = 1; // 1 frame\r
+ auto_repetition_pause_len = 0;\r
+ repeat_frame_pause_len = RECS80_FRAME_REPEAT_PAUSE_LEN;\r
+ irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_RECS80EXT_PROTOCOL == 1\r
- case IRMP_RECS80EXT_PROTOCOL:\r
- {\r
- startbit_pulse_len = RECS80EXT_START_BIT_PULSE_LEN;\r
- startbit_pause_len = RECS80EXT_START_BIT_PAUSE_LEN - 1;\r
- pulse_1_len = RECS80EXT_PULSE_LEN;\r
- pause_1_len = RECS80EXT_1_PAUSE_LEN - 1;\r
- pulse_0_len = RECS80EXT_PULSE_LEN;\r
- pause_0_len = RECS80EXT_0_PAUSE_LEN - 1;\r
- has_stop_bit = RECS80EXT_STOP_BIT;\r
- complete_data_len = RECS80EXT_COMPLETE_DATA_LEN;\r
- n_auto_repetitions = 1; // 1 frame\r
- auto_repetition_pause_len = 0;\r
- repeat_frame_pause_len = RECS80EXT_FRAME_REPEAT_PAUSE_LEN;\r
- irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
- break;\r
- }\r
+ case IRMP_RECS80EXT_PROTOCOL:\r
+ {\r
+ startbit_pulse_len = RECS80EXT_START_BIT_PULSE_LEN;\r
+ startbit_pause_len = RECS80EXT_START_BIT_PAUSE_LEN - 1;\r
+ pulse_1_len = RECS80EXT_PULSE_LEN;\r
+ pause_1_len = RECS80EXT_1_PAUSE_LEN - 1;\r
+ pulse_0_len = RECS80EXT_PULSE_LEN;\r
+ pause_0_len = RECS80EXT_0_PAUSE_LEN - 1;\r
+ has_stop_bit = RECS80EXT_STOP_BIT;\r
+ complete_data_len = RECS80EXT_COMPLETE_DATA_LEN;\r
+ n_auto_repetitions = 1; // 1 frame\r
+ auto_repetition_pause_len = 0;\r
+ repeat_frame_pause_len = RECS80EXT_FRAME_REPEAT_PAUSE_LEN;\r
+ irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_TELEFUNKEN_PROTOCOL == 1\r
- case IRMP_TELEFUNKEN_PROTOCOL:\r
- {\r
- startbit_pulse_len = TELEFUNKEN_START_BIT_PULSE_LEN;\r
- startbit_pause_len = TELEFUNKEN_START_BIT_PAUSE_LEN - 1;\r
- pulse_1_len = TELEFUNKEN_PULSE_LEN;\r
- pause_1_len = TELEFUNKEN_1_PAUSE_LEN - 1;\r
- pulse_0_len = TELEFUNKEN_PULSE_LEN;\r
- pause_0_len = TELEFUNKEN_0_PAUSE_LEN - 1;\r
- has_stop_bit = TELEFUNKEN_STOP_BIT;\r
- complete_data_len = TELEFUNKEN_COMPLETE_DATA_LEN;\r
- n_auto_repetitions = 1; // 1 frames\r
- auto_repetition_pause_len = 0; // TELEFUNKEN_AUTO_REPETITION_PAUSE_LEN; // xx ms pause\r
- repeat_frame_pause_len = TELEFUNKEN_FRAME_REPEAT_PAUSE_LEN; // 117 msec pause\r
- irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
- break;\r
- }\r
+ case IRMP_TELEFUNKEN_PROTOCOL:\r
+ {\r
+ startbit_pulse_len = TELEFUNKEN_START_BIT_PULSE_LEN;\r
+ startbit_pause_len = TELEFUNKEN_START_BIT_PAUSE_LEN - 1;\r
+ pulse_1_len = TELEFUNKEN_PULSE_LEN;\r
+ pause_1_len = TELEFUNKEN_1_PAUSE_LEN - 1;\r
+ pulse_0_len = TELEFUNKEN_PULSE_LEN;\r
+ pause_0_len = TELEFUNKEN_0_PAUSE_LEN - 1;\r
+ has_stop_bit = TELEFUNKEN_STOP_BIT;\r
+ complete_data_len = TELEFUNKEN_COMPLETE_DATA_LEN;\r
+ n_auto_repetitions = 1; // 1 frames\r
+ auto_repetition_pause_len = 0; // TELEFUNKEN_AUTO_REPETITION_PAUSE_LEN; // xx ms pause\r
+ repeat_frame_pause_len = TELEFUNKEN_FRAME_REPEAT_PAUSE_LEN; // 117 msec pause\r
+ irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_RC5_PROTOCOL == 1\r
- case IRMP_RC5_PROTOCOL:\r
- {\r
- startbit_pulse_len = RC5_BIT_LEN;\r
- startbit_pause_len = RC5_BIT_LEN;\r
- pulse_len = RC5_BIT_LEN;\r
- pause_len = RC5_BIT_LEN;\r
- has_stop_bit = RC5_STOP_BIT;\r
- complete_data_len = RC5_COMPLETE_DATA_LEN;\r
- n_auto_repetitions = 1; // 1 frame\r
- auto_repetition_pause_len = 0;\r
- repeat_frame_pause_len = RC5_FRAME_REPEAT_PAUSE_LEN;\r
- irsnd_set_freq (IRSND_FREQ_36_KHZ);\r
- break;\r
- }\r
+ case IRMP_RC5_PROTOCOL:\r
+ {\r
+ startbit_pulse_len = RC5_BIT_LEN;\r
+ startbit_pause_len = RC5_BIT_LEN;\r
+ pulse_len = RC5_BIT_LEN;\r
+ pause_len = RC5_BIT_LEN;\r
+ has_stop_bit = RC5_STOP_BIT;\r
+ complete_data_len = RC5_COMPLETE_DATA_LEN;\r
+ n_auto_repetitions = 1; // 1 frame\r
+ auto_repetition_pause_len = 0;\r
+ repeat_frame_pause_len = RC5_FRAME_REPEAT_PAUSE_LEN;\r
+ irsnd_set_freq (IRSND_FREQ_36_KHZ);\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_RC6_PROTOCOL == 1\r
- case IRMP_RC6_PROTOCOL:\r
- {\r
- startbit_pulse_len = RC6_START_BIT_PULSE_LEN;\r
- startbit_pause_len = RC6_START_BIT_PAUSE_LEN - 1;\r
- pulse_len = RC6_BIT_LEN;\r
- pause_len = RC6_BIT_LEN;\r
- has_stop_bit = RC6_STOP_BIT;\r
- complete_data_len = RC6_COMPLETE_DATA_LEN_SHORT;\r
- n_auto_repetitions = 1; // 1 frame\r
- auto_repetition_pause_len = 0;\r
- repeat_frame_pause_len = RC6_FRAME_REPEAT_PAUSE_LEN;\r
- irsnd_set_freq (IRSND_FREQ_36_KHZ);\r
- break;\r
- }\r
+ case IRMP_RC6_PROTOCOL:\r
+ {\r
+ startbit_pulse_len = RC6_START_BIT_PULSE_LEN;\r
+ startbit_pause_len = RC6_START_BIT_PAUSE_LEN - 1;\r
+ pulse_len = RC6_BIT_LEN;\r
+ pause_len = RC6_BIT_LEN;\r
+ has_stop_bit = RC6_STOP_BIT;\r
+ complete_data_len = RC6_COMPLETE_DATA_LEN_SHORT;\r
+ n_auto_repetitions = 1; // 1 frame\r
+ auto_repetition_pause_len = 0;\r
+ repeat_frame_pause_len = RC6_FRAME_REPEAT_PAUSE_LEN;\r
+ irsnd_set_freq (IRSND_FREQ_36_KHZ);\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_RC6A_PROTOCOL == 1\r
- case IRMP_RC6A_PROTOCOL:\r
- {\r
- startbit_pulse_len = RC6_START_BIT_PULSE_LEN;\r
- startbit_pause_len = RC6_START_BIT_PAUSE_LEN - 1;\r
- pulse_len = RC6_BIT_LEN;\r
- pause_len = RC6_BIT_LEN;\r
- has_stop_bit = RC6_STOP_BIT;\r
- complete_data_len = RC6_COMPLETE_DATA_LEN_LONG;\r
- n_auto_repetitions = 1; // 1 frame\r
- auto_repetition_pause_len = 0;\r
- repeat_frame_pause_len = RC6_FRAME_REPEAT_PAUSE_LEN;\r
- irsnd_set_freq (IRSND_FREQ_36_KHZ);\r
- break;\r
- }\r
+ case IRMP_RC6A_PROTOCOL:\r
+ {\r
+ startbit_pulse_len = RC6_START_BIT_PULSE_LEN;\r
+ startbit_pause_len = RC6_START_BIT_PAUSE_LEN - 1;\r
+ pulse_len = RC6_BIT_LEN;\r
+ pause_len = RC6_BIT_LEN;\r
+ has_stop_bit = RC6_STOP_BIT;\r
+ complete_data_len = RC6_COMPLETE_DATA_LEN_LONG;\r
+ n_auto_repetitions = 1; // 1 frame\r
+ auto_repetition_pause_len = 0;\r
+ repeat_frame_pause_len = RC6_FRAME_REPEAT_PAUSE_LEN;\r
+ irsnd_set_freq (IRSND_FREQ_36_KHZ);\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_DENON_PROTOCOL == 1\r
- case IRMP_DENON_PROTOCOL:\r
- {\r
- startbit_pulse_len = 0x00;\r
- startbit_pause_len = 0x00;\r
- pulse_1_len = DENON_PULSE_LEN;\r
- pause_1_len = DENON_1_PAUSE_LEN - 1;\r
- pulse_0_len = DENON_PULSE_LEN;\r
- pause_0_len = DENON_0_PAUSE_LEN - 1;\r
- has_stop_bit = DENON_STOP_BIT;\r
- complete_data_len = DENON_COMPLETE_DATA_LEN;\r
- n_auto_repetitions = DENON_FRAMES; // 2 frames, 2nd with inverted command\r
- auto_repetition_pause_len = DENON_AUTO_REPETITION_PAUSE_LEN; // 65 ms pause after 1st frame\r
- repeat_frame_pause_len = DENON_FRAME_REPEAT_PAUSE_LEN;\r
- irsnd_set_freq (IRSND_FREQ_36_KHZ); // in theory 32kHz, in practice 36kHz is better\r
- break;\r
- }\r
+ case IRMP_DENON_PROTOCOL:\r
+ {\r
+ startbit_pulse_len = 0x00;\r
+ startbit_pause_len = 0x00;\r
+ pulse_1_len = DENON_PULSE_LEN;\r
+ pause_1_len = DENON_1_PAUSE_LEN - 1;\r
+ pulse_0_len = DENON_PULSE_LEN;\r
+ pause_0_len = DENON_0_PAUSE_LEN - 1;\r
+ has_stop_bit = DENON_STOP_BIT;\r
+ complete_data_len = DENON_COMPLETE_DATA_LEN;\r
+ n_auto_repetitions = DENON_FRAMES; // 2 frames, 2nd with inverted command\r
+ auto_repetition_pause_len = DENON_AUTO_REPETITION_PAUSE_LEN; // 65 ms pause after 1st frame\r
+ repeat_frame_pause_len = DENON_FRAME_REPEAT_PAUSE_LEN;\r
+ irsnd_set_freq (IRSND_FREQ_36_KHZ); // in theory 32kHz, in practice 36kHz is better\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_THOMSON_PROTOCOL == 1\r
- case IRMP_THOMSON_PROTOCOL:\r
- {\r
- startbit_pulse_len = 0x00;\r
- startbit_pause_len = 0x00;\r
- pulse_1_len = THOMSON_PULSE_LEN;\r
- pause_1_len = THOMSON_1_PAUSE_LEN - 1;\r
- pulse_0_len = THOMSON_PULSE_LEN;\r
- pause_0_len = THOMSON_0_PAUSE_LEN - 1;\r
- has_stop_bit = THOMSON_STOP_BIT;\r
- complete_data_len = THOMSON_COMPLETE_DATA_LEN;\r
- n_auto_repetitions = THOMSON_FRAMES; // only 1 frame\r
- auto_repetition_pause_len = THOMSON_AUTO_REPETITION_PAUSE_LEN;\r
- repeat_frame_pause_len = THOMSON_FRAME_REPEAT_PAUSE_LEN;\r
- irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
- break;\r
- }\r
+ case IRMP_THOMSON_PROTOCOL:\r
+ {\r
+ startbit_pulse_len = 0x00;\r
+ startbit_pause_len = 0x00;\r
+ pulse_1_len = THOMSON_PULSE_LEN;\r
+ pause_1_len = THOMSON_1_PAUSE_LEN - 1;\r
+ pulse_0_len = THOMSON_PULSE_LEN;\r
+ pause_0_len = THOMSON_0_PAUSE_LEN - 1;\r
+ has_stop_bit = THOMSON_STOP_BIT;\r
+ complete_data_len = THOMSON_COMPLETE_DATA_LEN;\r
+ n_auto_repetitions = THOMSON_FRAMES; // only 1 frame\r
+ auto_repetition_pause_len = THOMSON_AUTO_REPETITION_PAUSE_LEN;\r
+ repeat_frame_pause_len = THOMSON_FRAME_REPEAT_PAUSE_LEN;\r
+ irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_BOSE_PROTOCOL == 1\r
- case IRMP_BOSE_PROTOCOL:\r
- {\r
- startbit_pulse_len = BOSE_START_BIT_PULSE_LEN;\r
- startbit_pause_len = BOSE_START_BIT_PAUSE_LEN - 1;\r
- pulse_1_len = BOSE_PULSE_LEN;\r
- pause_1_len = BOSE_1_PAUSE_LEN - 1;\r
- pulse_0_len = BOSE_PULSE_LEN;\r
- pause_0_len = BOSE_0_PAUSE_LEN - 1;\r
- has_stop_bit = BOSE_STOP_BIT;\r
- complete_data_len = BOSE_COMPLETE_DATA_LEN;\r
- n_auto_repetitions = BOSE_FRAMES; // 1 frame\r
- auto_repetition_pause_len = BOSE_AUTO_REPETITION_PAUSE_LEN; // 40 ms pause\r
- repeat_frame_pause_len = BOSE_FRAME_REPEAT_PAUSE_LEN;\r
- irsnd_set_freq (IRSND_FREQ_36_KHZ);\r
- break;\r
- }\r
+ case IRMP_BOSE_PROTOCOL:\r
+ {\r
+ startbit_pulse_len = BOSE_START_BIT_PULSE_LEN;\r
+ startbit_pause_len = BOSE_START_BIT_PAUSE_LEN - 1;\r
+ pulse_1_len = BOSE_PULSE_LEN;\r
+ pause_1_len = BOSE_1_PAUSE_LEN - 1;\r
+ pulse_0_len = BOSE_PULSE_LEN;\r
+ pause_0_len = BOSE_0_PAUSE_LEN - 1;\r
+ has_stop_bit = BOSE_STOP_BIT;\r
+ complete_data_len = BOSE_COMPLETE_DATA_LEN;\r
+ n_auto_repetitions = BOSE_FRAMES; // 1 frame\r
+ auto_repetition_pause_len = BOSE_AUTO_REPETITION_PAUSE_LEN; // 40 ms pause\r
+ repeat_frame_pause_len = BOSE_FRAME_REPEAT_PAUSE_LEN;\r
+ irsnd_set_freq (IRSND_FREQ_36_KHZ);\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_NUBERT_PROTOCOL == 1\r
- case IRMP_NUBERT_PROTOCOL:\r
- {\r
- startbit_pulse_len = NUBERT_START_BIT_PULSE_LEN;\r
- startbit_pause_len = NUBERT_START_BIT_PAUSE_LEN - 1;\r
- pulse_1_len = NUBERT_1_PULSE_LEN;\r
- pause_1_len = NUBERT_1_PAUSE_LEN - 1;\r
- pulse_0_len = NUBERT_0_PULSE_LEN;\r
- pause_0_len = NUBERT_0_PAUSE_LEN - 1;\r
- has_stop_bit = NUBERT_STOP_BIT;\r
- complete_data_len = NUBERT_COMPLETE_DATA_LEN;\r
- n_auto_repetitions = NUBERT_FRAMES; // 2 frames\r
- auto_repetition_pause_len = NUBERT_AUTO_REPETITION_PAUSE_LEN; // 35 ms pause\r
- repeat_frame_pause_len = NUBERT_FRAME_REPEAT_PAUSE_LEN;\r
- irsnd_set_freq (IRSND_FREQ_36_KHZ);\r
- break;\r
- }\r
+ case IRMP_NUBERT_PROTOCOL:\r
+ {\r
+ startbit_pulse_len = NUBERT_START_BIT_PULSE_LEN;\r
+ startbit_pause_len = NUBERT_START_BIT_PAUSE_LEN - 1;\r
+ pulse_1_len = NUBERT_1_PULSE_LEN;\r
+ pause_1_len = NUBERT_1_PAUSE_LEN - 1;\r
+ pulse_0_len = NUBERT_0_PULSE_LEN;\r
+ pause_0_len = NUBERT_0_PAUSE_LEN - 1;\r
+ has_stop_bit = NUBERT_STOP_BIT;\r
+ complete_data_len = NUBERT_COMPLETE_DATA_LEN;\r
+ n_auto_repetitions = NUBERT_FRAMES; // 2 frames\r
+ auto_repetition_pause_len = NUBERT_AUTO_REPETITION_PAUSE_LEN; // 35 ms pause\r
+ repeat_frame_pause_len = NUBERT_FRAME_REPEAT_PAUSE_LEN;\r
+ irsnd_set_freq (IRSND_FREQ_36_KHZ);\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_FAN_PROTOCOL == 1\r
- case IRMP_FAN_PROTOCOL:\r
- {\r
- startbit_pulse_len = FAN_START_BIT_PULSE_LEN;\r
- startbit_pause_len = FAN_START_BIT_PAUSE_LEN - 1;\r
- pulse_1_len = FAN_1_PULSE_LEN;\r
- pause_1_len = FAN_1_PAUSE_LEN - 1;\r
- pulse_0_len = FAN_0_PULSE_LEN;\r
- pause_0_len = FAN_0_PAUSE_LEN - 1;\r
- has_stop_bit = FAN_STOP_BIT;\r
- complete_data_len = FAN_COMPLETE_DATA_LEN;\r
- n_auto_repetitions = FAN_FRAMES; // only 1 frame\r
- auto_repetition_pause_len = FAN_AUTO_REPETITION_PAUSE_LEN; // 35 ms pause\r
- repeat_frame_pause_len = FAN_FRAME_REPEAT_PAUSE_LEN;\r
- irsnd_set_freq (IRSND_FREQ_36_KHZ);\r
- break;\r
- }\r
+ case IRMP_FAN_PROTOCOL:\r
+ {\r
+ startbit_pulse_len = FAN_START_BIT_PULSE_LEN;\r
+ startbit_pause_len = FAN_START_BIT_PAUSE_LEN - 1;\r
+ pulse_1_len = FAN_1_PULSE_LEN;\r
+ pause_1_len = FAN_1_PAUSE_LEN - 1;\r
+ pulse_0_len = FAN_0_PULSE_LEN;\r
+ pause_0_len = FAN_0_PAUSE_LEN - 1;\r
+ has_stop_bit = FAN_STOP_BIT;\r
+ complete_data_len = FAN_COMPLETE_DATA_LEN;\r
+ n_auto_repetitions = FAN_FRAMES; // only 1 frame\r
+ auto_repetition_pause_len = FAN_AUTO_REPETITION_PAUSE_LEN; // 35 ms pause\r
+ repeat_frame_pause_len = FAN_FRAME_REPEAT_PAUSE_LEN;\r
+ irsnd_set_freq (IRSND_FREQ_36_KHZ);\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_SPEAKER_PROTOCOL == 1\r
- case IRMP_SPEAKER_PROTOCOL:\r
- {\r
- startbit_pulse_len = SPEAKER_START_BIT_PULSE_LEN;\r
- startbit_pause_len = SPEAKER_START_BIT_PAUSE_LEN - 1;\r
- pulse_1_len = SPEAKER_1_PULSE_LEN;\r
- pause_1_len = SPEAKER_1_PAUSE_LEN - 1;\r
- pulse_0_len = SPEAKER_0_PULSE_LEN;\r
- pause_0_len = SPEAKER_0_PAUSE_LEN - 1;\r
- has_stop_bit = SPEAKER_STOP_BIT;\r
- complete_data_len = SPEAKER_COMPLETE_DATA_LEN;\r
- n_auto_repetitions = SPEAKER_FRAMES; // 2 frames\r
- auto_repetition_pause_len = SPEAKER_AUTO_REPETITION_PAUSE_LEN; // 35 ms pause\r
- repeat_frame_pause_len = SPEAKER_FRAME_REPEAT_PAUSE_LEN;\r
- irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
- break;\r
- }\r
+ case IRMP_SPEAKER_PROTOCOL:\r
+ {\r
+ startbit_pulse_len = SPEAKER_START_BIT_PULSE_LEN;\r
+ startbit_pause_len = SPEAKER_START_BIT_PAUSE_LEN - 1;\r
+ pulse_1_len = SPEAKER_1_PULSE_LEN;\r
+ pause_1_len = SPEAKER_1_PAUSE_LEN - 1;\r
+ pulse_0_len = SPEAKER_0_PULSE_LEN;\r
+ pause_0_len = SPEAKER_0_PAUSE_LEN - 1;\r
+ has_stop_bit = SPEAKER_STOP_BIT;\r
+ complete_data_len = SPEAKER_COMPLETE_DATA_LEN;\r
+ n_auto_repetitions = SPEAKER_FRAMES; // 2 frames\r
+ auto_repetition_pause_len = SPEAKER_AUTO_REPETITION_PAUSE_LEN; // 35 ms pause\r
+ repeat_frame_pause_len = SPEAKER_FRAME_REPEAT_PAUSE_LEN;\r
+ irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1\r
- case IRMP_BANG_OLUFSEN_PROTOCOL:\r
- {\r
- startbit_pulse_len = BANG_OLUFSEN_START_BIT1_PULSE_LEN;\r
- startbit_pause_len = BANG_OLUFSEN_START_BIT1_PAUSE_LEN - 1;\r
- pulse_1_len = BANG_OLUFSEN_PULSE_LEN;\r
- pause_1_len = BANG_OLUFSEN_1_PAUSE_LEN - 1;\r
- pulse_0_len = BANG_OLUFSEN_PULSE_LEN;\r
- pause_0_len = BANG_OLUFSEN_0_PAUSE_LEN - 1;\r
- has_stop_bit = BANG_OLUFSEN_STOP_BIT;\r
- complete_data_len = BANG_OLUFSEN_COMPLETE_DATA_LEN;\r
- n_auto_repetitions = 1; // 1 frame\r
- auto_repetition_pause_len = 0;\r
- repeat_frame_pause_len = BANG_OLUFSEN_FRAME_REPEAT_PAUSE_LEN;\r
- last_bit_value = 0;\r
- irsnd_set_freq (IRSND_FREQ_455_KHZ);\r
- break;\r
- }\r
+ case IRMP_BANG_OLUFSEN_PROTOCOL:\r
+ {\r
+ startbit_pulse_len = BANG_OLUFSEN_START_BIT1_PULSE_LEN;\r
+ startbit_pause_len = BANG_OLUFSEN_START_BIT1_PAUSE_LEN - 1;\r
+ pulse_1_len = BANG_OLUFSEN_PULSE_LEN;\r
+ pause_1_len = BANG_OLUFSEN_1_PAUSE_LEN - 1;\r
+ pulse_0_len = BANG_OLUFSEN_PULSE_LEN;\r
+ pause_0_len = BANG_OLUFSEN_0_PAUSE_LEN - 1;\r
+ has_stop_bit = BANG_OLUFSEN_STOP_BIT;\r
+ complete_data_len = BANG_OLUFSEN_COMPLETE_DATA_LEN;\r
+ n_auto_repetitions = 1; // 1 frame\r
+ auto_repetition_pause_len = 0;\r
+ repeat_frame_pause_len = BANG_OLUFSEN_FRAME_REPEAT_PAUSE_LEN;\r
+ last_bit_value = 0;\r
+ irsnd_set_freq (IRSND_FREQ_455_KHZ);\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_GRUNDIG_PROTOCOL == 1\r
- case IRMP_GRUNDIG_PROTOCOL:\r
- {\r
- startbit_pulse_len = GRUNDIG_NOKIA_IR60_BIT_LEN;\r
- startbit_pause_len = GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN - 1;\r
- pulse_len = GRUNDIG_NOKIA_IR60_BIT_LEN;\r
- pause_len = GRUNDIG_NOKIA_IR60_BIT_LEN;\r
- has_stop_bit = GRUNDIG_NOKIA_IR60_STOP_BIT;\r
- complete_data_len = GRUNDIG_COMPLETE_DATA_LEN;\r
- n_auto_repetitions = GRUNDIG_FRAMES; // 2 frames\r
- auto_repetition_pause_len = GRUNDIG_AUTO_REPETITION_PAUSE_LEN; // 20m sec pause\r
- repeat_frame_pause_len = GRUNDIG_NOKIA_IR60_FRAME_REPEAT_PAUSE_LEN; // 117 msec pause\r
- irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
- break;\r
- }\r
+ case IRMP_GRUNDIG_PROTOCOL:\r
+ {\r
+ startbit_pulse_len = GRUNDIG_NOKIA_IR60_BIT_LEN;\r
+ startbit_pause_len = GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN - 1;\r
+ pulse_len = GRUNDIG_NOKIA_IR60_BIT_LEN;\r
+ pause_len = GRUNDIG_NOKIA_IR60_BIT_LEN;\r
+ has_stop_bit = GRUNDIG_NOKIA_IR60_STOP_BIT;\r
+ complete_data_len = GRUNDIG_COMPLETE_DATA_LEN;\r
+ n_auto_repetitions = GRUNDIG_FRAMES; // 2 frames\r
+ auto_repetition_pause_len = GRUNDIG_AUTO_REPETITION_PAUSE_LEN; // 20m sec pause\r
+ repeat_frame_pause_len = GRUNDIG_NOKIA_IR60_FRAME_REPEAT_PAUSE_LEN; // 117 msec pause\r
+ irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_IR60_PROTOCOL == 1\r
- case IRMP_IR60_PROTOCOL:\r
- {\r
- startbit_pulse_len = GRUNDIG_NOKIA_IR60_BIT_LEN;\r
- startbit_pause_len = GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN - 1;\r
- pulse_len = GRUNDIG_NOKIA_IR60_BIT_LEN;\r
- pause_len = GRUNDIG_NOKIA_IR60_BIT_LEN;\r
- has_stop_bit = GRUNDIG_NOKIA_IR60_STOP_BIT;\r
- complete_data_len = IR60_COMPLETE_DATA_LEN;\r
- n_auto_repetitions = IR60_FRAMES; // 2 frames\r
- auto_repetition_pause_len = IR60_AUTO_REPETITION_PAUSE_LEN; // 20m sec pause\r
- repeat_frame_pause_len = GRUNDIG_NOKIA_IR60_FRAME_REPEAT_PAUSE_LEN; // 117 msec pause\r
- irsnd_set_freq (IRSND_FREQ_30_KHZ);\r
- break;\r
- }\r
+ case IRMP_IR60_PROTOCOL:\r
+ {\r
+ startbit_pulse_len = GRUNDIG_NOKIA_IR60_BIT_LEN;\r
+ startbit_pause_len = GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN - 1;\r
+ pulse_len = GRUNDIG_NOKIA_IR60_BIT_LEN;\r
+ pause_len = GRUNDIG_NOKIA_IR60_BIT_LEN;\r
+ has_stop_bit = GRUNDIG_NOKIA_IR60_STOP_BIT;\r
+ complete_data_len = IR60_COMPLETE_DATA_LEN;\r
+ n_auto_repetitions = IR60_FRAMES; // 2 frames\r
+ auto_repetition_pause_len = IR60_AUTO_REPETITION_PAUSE_LEN; // 20m sec pause\r
+ repeat_frame_pause_len = GRUNDIG_NOKIA_IR60_FRAME_REPEAT_PAUSE_LEN; // 117 msec pause\r
+ irsnd_set_freq (IRSND_FREQ_30_KHZ);\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_NOKIA_PROTOCOL == 1\r
- case IRMP_NOKIA_PROTOCOL:\r
- {\r
- startbit_pulse_len = GRUNDIG_NOKIA_IR60_BIT_LEN;\r
- startbit_pause_len = GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN - 1;\r
- pulse_len = GRUNDIG_NOKIA_IR60_BIT_LEN;\r
- pause_len = GRUNDIG_NOKIA_IR60_BIT_LEN;\r
- has_stop_bit = GRUNDIG_NOKIA_IR60_STOP_BIT;\r
- complete_data_len = NOKIA_COMPLETE_DATA_LEN;\r
- n_auto_repetitions = NOKIA_FRAMES; // 2 frames\r
- auto_repetition_pause_len = NOKIA_AUTO_REPETITION_PAUSE_LEN; // 20 msec pause\r
- repeat_frame_pause_len = GRUNDIG_NOKIA_IR60_FRAME_REPEAT_PAUSE_LEN; // 117 msec pause\r
- irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
- break;\r
- }\r
+ case IRMP_NOKIA_PROTOCOL:\r
+ {\r
+ startbit_pulse_len = GRUNDIG_NOKIA_IR60_BIT_LEN;\r
+ startbit_pause_len = GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN - 1;\r
+ pulse_len = GRUNDIG_NOKIA_IR60_BIT_LEN;\r
+ pause_len = GRUNDIG_NOKIA_IR60_BIT_LEN;\r
+ has_stop_bit = GRUNDIG_NOKIA_IR60_STOP_BIT;\r
+ complete_data_len = NOKIA_COMPLETE_DATA_LEN;\r
+ n_auto_repetitions = NOKIA_FRAMES; // 2 frames\r
+ auto_repetition_pause_len = NOKIA_AUTO_REPETITION_PAUSE_LEN; // 20 msec pause\r
+ repeat_frame_pause_len = GRUNDIG_NOKIA_IR60_FRAME_REPEAT_PAUSE_LEN; // 117 msec pause\r
+ irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_SIEMENS_PROTOCOL == 1\r
- case IRMP_SIEMENS_PROTOCOL:\r
- {\r
- startbit_pulse_len = SIEMENS_BIT_LEN;\r
- startbit_pause_len = SIEMENS_BIT_LEN;\r
- pulse_len = SIEMENS_BIT_LEN;\r
- pause_len = SIEMENS_BIT_LEN;\r
- has_stop_bit = SIEMENS_OR_RUWIDO_STOP_BIT;\r
- complete_data_len = SIEMENS_COMPLETE_DATA_LEN;\r
- n_auto_repetitions = 1; // 1 frame\r
- auto_repetition_pause_len = 0;\r
- repeat_frame_pause_len = SIEMENS_FRAME_REPEAT_PAUSE_LEN;\r
- irsnd_set_freq (IRSND_FREQ_36_KHZ);\r
- break;\r
- }\r
+ case IRMP_SIEMENS_PROTOCOL:\r
+ {\r
+ startbit_pulse_len = SIEMENS_BIT_LEN;\r
+ startbit_pause_len = SIEMENS_BIT_LEN;\r
+ pulse_len = SIEMENS_BIT_LEN;\r
+ pause_len = SIEMENS_BIT_LEN;\r
+ has_stop_bit = SIEMENS_OR_RUWIDO_STOP_BIT;\r
+ complete_data_len = SIEMENS_COMPLETE_DATA_LEN;\r
+ n_auto_repetitions = 1; // 1 frame\r
+ auto_repetition_pause_len = 0;\r
+ repeat_frame_pause_len = SIEMENS_FRAME_REPEAT_PAUSE_LEN;\r
+ irsnd_set_freq (IRSND_FREQ_36_KHZ);\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_RUWIDO_PROTOCOL == 1\r
- case IRMP_RUWIDO_PROTOCOL:\r
- {\r
- startbit_pulse_len = RUWIDO_START_BIT_PULSE_LEN;\r
- startbit_pause_len = RUWIDO_START_BIT_PAUSE_LEN;\r
- pulse_len = RUWIDO_BIT_PULSE_LEN;\r
- pause_len = RUWIDO_BIT_PAUSE_LEN;\r
- has_stop_bit = SIEMENS_OR_RUWIDO_STOP_BIT;\r
- complete_data_len = RUWIDO_COMPLETE_DATA_LEN;\r
- n_auto_repetitions = 1; // 1 frame\r
- auto_repetition_pause_len = 0;\r
- repeat_frame_pause_len = RUWIDO_FRAME_REPEAT_PAUSE_LEN;\r
- irsnd_set_freq (IRSND_FREQ_36_KHZ);\r
- break;\r
- }\r
+ case IRMP_RUWIDO_PROTOCOL:\r
+ {\r
+ startbit_pulse_len = RUWIDO_START_BIT_PULSE_LEN;\r
+ startbit_pause_len = RUWIDO_START_BIT_PAUSE_LEN;\r
+ pulse_len = RUWIDO_BIT_PULSE_LEN;\r
+ pause_len = RUWIDO_BIT_PAUSE_LEN;\r
+ has_stop_bit = SIEMENS_OR_RUWIDO_STOP_BIT;\r
+ complete_data_len = RUWIDO_COMPLETE_DATA_LEN;\r
+ n_auto_repetitions = 1; // 1 frame\r
+ auto_repetition_pause_len = 0;\r
+ repeat_frame_pause_len = RUWIDO_FRAME_REPEAT_PAUSE_LEN;\r
+ irsnd_set_freq (IRSND_FREQ_36_KHZ);\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_FDC_PROTOCOL == 1\r
- case IRMP_FDC_PROTOCOL:\r
- {\r
- startbit_pulse_len = FDC_START_BIT_PULSE_LEN;\r
- startbit_pause_len = FDC_START_BIT_PAUSE_LEN - 1;\r
- complete_data_len = FDC_COMPLETE_DATA_LEN;\r
- pulse_1_len = FDC_PULSE_LEN;\r
- pause_1_len = FDC_1_PAUSE_LEN - 1;\r
- pulse_0_len = FDC_PULSE_LEN;\r
- pause_0_len = FDC_0_PAUSE_LEN - 1;\r
- has_stop_bit = FDC_STOP_BIT;\r
- n_auto_repetitions = 1; // 1 frame\r
- auto_repetition_pause_len = 0;\r
- repeat_frame_pause_len = FDC_FRAME_REPEAT_PAUSE_LEN;\r
- irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
- break;\r
- }\r
+ case IRMP_FDC_PROTOCOL:\r
+ {\r
+ startbit_pulse_len = FDC_START_BIT_PULSE_LEN;\r
+ startbit_pause_len = FDC_START_BIT_PAUSE_LEN - 1;\r
+ complete_data_len = FDC_COMPLETE_DATA_LEN;\r
+ pulse_1_len = FDC_PULSE_LEN;\r
+ pause_1_len = FDC_1_PAUSE_LEN - 1;\r
+ pulse_0_len = FDC_PULSE_LEN;\r
+ pause_0_len = FDC_0_PAUSE_LEN - 1;\r
+ has_stop_bit = FDC_STOP_BIT;\r
+ n_auto_repetitions = 1; // 1 frame\r
+ auto_repetition_pause_len = 0;\r
+ repeat_frame_pause_len = FDC_FRAME_REPEAT_PAUSE_LEN;\r
+ irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_RCCAR_PROTOCOL == 1\r
- case IRMP_RCCAR_PROTOCOL:\r
- {\r
- startbit_pulse_len = RCCAR_START_BIT_PULSE_LEN;\r
- startbit_pause_len = RCCAR_START_BIT_PAUSE_LEN - 1;\r
- complete_data_len = RCCAR_COMPLETE_DATA_LEN;\r
- pulse_1_len = RCCAR_PULSE_LEN;\r
- pause_1_len = RCCAR_1_PAUSE_LEN - 1;\r
- pulse_0_len = RCCAR_PULSE_LEN;\r
- pause_0_len = RCCAR_0_PAUSE_LEN - 1;\r
- has_stop_bit = RCCAR_STOP_BIT;\r
- n_auto_repetitions = 1; // 1 frame\r
- auto_repetition_pause_len = 0;\r
- repeat_frame_pause_len = RCCAR_FRAME_REPEAT_PAUSE_LEN;\r
- irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
- break;\r
- }\r
+ case IRMP_RCCAR_PROTOCOL:\r
+ {\r
+ startbit_pulse_len = RCCAR_START_BIT_PULSE_LEN;\r
+ startbit_pause_len = RCCAR_START_BIT_PAUSE_LEN - 1;\r
+ complete_data_len = RCCAR_COMPLETE_DATA_LEN;\r
+ pulse_1_len = RCCAR_PULSE_LEN;\r
+ pause_1_len = RCCAR_1_PAUSE_LEN - 1;\r
+ pulse_0_len = RCCAR_PULSE_LEN;\r
+ pause_0_len = RCCAR_0_PAUSE_LEN - 1;\r
+ has_stop_bit = RCCAR_STOP_BIT;\r
+ n_auto_repetitions = 1; // 1 frame\r
+ auto_repetition_pause_len = 0;\r
+ repeat_frame_pause_len = RCCAR_FRAME_REPEAT_PAUSE_LEN;\r
+ irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_JVC_PROTOCOL == 1\r
- case IRMP_JVC_PROTOCOL:\r
- {\r
- if (repeat_counter != 0) // skip start bit if repetition frame\r
- {\r
- current_bit = 0;\r
- }\r
-\r
- startbit_pulse_len = JVC_START_BIT_PULSE_LEN;\r
- startbit_pause_len = JVC_START_BIT_PAUSE_LEN - 1;\r
- complete_data_len = JVC_COMPLETE_DATA_LEN;\r
- pulse_1_len = JVC_PULSE_LEN;\r
- pause_1_len = JVC_1_PAUSE_LEN - 1;\r
- pulse_0_len = JVC_PULSE_LEN;\r
- pause_0_len = JVC_0_PAUSE_LEN - 1;\r
- has_stop_bit = JVC_STOP_BIT;\r
- n_auto_repetitions = 1; // 1 frame\r
- auto_repetition_pause_len = 0;\r
- repeat_frame_pause_len = JVC_FRAME_REPEAT_PAUSE_LEN;\r
- irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
- break;\r
- }\r
+ case IRMP_JVC_PROTOCOL:\r
+ {\r
+ if (repeat_counter != 0) // skip start bit if repetition frame\r
+ {\r
+ current_bit = 0;\r
+ }\r
+\r
+ startbit_pulse_len = JVC_START_BIT_PULSE_LEN;\r
+ startbit_pause_len = JVC_START_BIT_PAUSE_LEN - 1;\r
+ complete_data_len = JVC_COMPLETE_DATA_LEN;\r
+ pulse_1_len = JVC_PULSE_LEN;\r
+ pause_1_len = JVC_1_PAUSE_LEN - 1;\r
+ pulse_0_len = JVC_PULSE_LEN;\r
+ pause_0_len = JVC_0_PAUSE_LEN - 1;\r
+ has_stop_bit = JVC_STOP_BIT;\r
+ n_auto_repetitions = 1; // 1 frame\r
+ auto_repetition_pause_len = 0;\r
+ repeat_frame_pause_len = JVC_FRAME_REPEAT_PAUSE_LEN;\r
+ irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_NIKON_PROTOCOL == 1\r
- case IRMP_NIKON_PROTOCOL:\r
- {\r
- startbit_pulse_len = NIKON_START_BIT_PULSE_LEN;\r
- startbit_pause_len = NIKON_START_BIT_PAUSE_LEN;\r
- complete_data_len = NIKON_COMPLETE_DATA_LEN;\r
- pulse_1_len = NIKON_PULSE_LEN;\r
- pause_1_len = NIKON_1_PAUSE_LEN - 1;\r
- pulse_0_len = NIKON_PULSE_LEN;\r
- pause_0_len = NIKON_0_PAUSE_LEN - 1;\r
- has_stop_bit = NIKON_STOP_BIT;\r
- n_auto_repetitions = 1; // 1 frame\r
- auto_repetition_pause_len = 0;\r
- repeat_frame_pause_len = NIKON_FRAME_REPEAT_PAUSE_LEN;\r
- irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
- break;\r
- }\r
+ case IRMP_NIKON_PROTOCOL:\r
+ {\r
+ startbit_pulse_len = NIKON_START_BIT_PULSE_LEN;\r
+ startbit_pause_len = NIKON_START_BIT_PAUSE_LEN;\r
+ complete_data_len = NIKON_COMPLETE_DATA_LEN;\r
+ pulse_1_len = NIKON_PULSE_LEN;\r
+ pause_1_len = NIKON_1_PAUSE_LEN - 1;\r
+ pulse_0_len = NIKON_PULSE_LEN;\r
+ pause_0_len = NIKON_0_PAUSE_LEN - 1;\r
+ has_stop_bit = NIKON_STOP_BIT;\r
+ n_auto_repetitions = 1; // 1 frame\r
+ auto_repetition_pause_len = 0;\r
+ repeat_frame_pause_len = NIKON_FRAME_REPEAT_PAUSE_LEN;\r
+ irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_LEGO_PROTOCOL == 1\r
- case IRMP_LEGO_PROTOCOL:\r
- {\r
- startbit_pulse_len = LEGO_START_BIT_PULSE_LEN;\r
- startbit_pause_len = LEGO_START_BIT_PAUSE_LEN - 1;\r
- complete_data_len = LEGO_COMPLETE_DATA_LEN;\r
- pulse_1_len = LEGO_PULSE_LEN;\r
- pause_1_len = LEGO_1_PAUSE_LEN - 1;\r
- pulse_0_len = LEGO_PULSE_LEN;\r
- pause_0_len = LEGO_0_PAUSE_LEN - 1;\r
- has_stop_bit = LEGO_STOP_BIT;\r
- n_auto_repetitions = 1; // 1 frame\r
- auto_repetition_pause_len = 0;\r
- repeat_frame_pause_len = LEGO_FRAME_REPEAT_PAUSE_LEN;\r
- irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
- break;\r
- }\r
+ case IRMP_LEGO_PROTOCOL:\r
+ {\r
+ startbit_pulse_len = LEGO_START_BIT_PULSE_LEN;\r
+ startbit_pause_len = LEGO_START_BIT_PAUSE_LEN - 1;\r
+ complete_data_len = LEGO_COMPLETE_DATA_LEN;\r
+ pulse_1_len = LEGO_PULSE_LEN;\r
+ pause_1_len = LEGO_1_PAUSE_LEN - 1;\r
+ pulse_0_len = LEGO_PULSE_LEN;\r
+ pause_0_len = LEGO_0_PAUSE_LEN - 1;\r
+ has_stop_bit = LEGO_STOP_BIT;\r
+ n_auto_repetitions = 1; // 1 frame\r
+ auto_repetition_pause_len = 0;\r
+ repeat_frame_pause_len = LEGO_FRAME_REPEAT_PAUSE_LEN;\r
+ irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_A1TVBOX_PROTOCOL == 1\r
- case IRMP_A1TVBOX_PROTOCOL:\r
- {\r
- startbit_pulse_len = A1TVBOX_BIT_PULSE_LEN; // don't use A1TVBOX_START_BIT_PULSE_LEN\r
- startbit_pause_len = A1TVBOX_BIT_PAUSE_LEN; // don't use A1TVBOX_START_BIT_PAUSE_LEN\r
- pulse_len = A1TVBOX_BIT_PULSE_LEN;\r
- pause_len = A1TVBOX_BIT_PAUSE_LEN;\r
- has_stop_bit = A1TVBOX_STOP_BIT;\r
- complete_data_len = A1TVBOX_COMPLETE_DATA_LEN + 1; // we send stop bit as data\r
- n_auto_repetitions = 1; // 1 frame\r
- auto_repetition_pause_len = 0;\r
- repeat_frame_pause_len = A1TVBOX_FRAME_REPEAT_PAUSE_LEN;\r
- irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
- break;\r
- }\r
+ case IRMP_A1TVBOX_PROTOCOL:\r
+ {\r
+ startbit_pulse_len = A1TVBOX_BIT_PULSE_LEN; // don't use A1TVBOX_START_BIT_PULSE_LEN\r
+ startbit_pause_len = A1TVBOX_BIT_PAUSE_LEN; // don't use A1TVBOX_START_BIT_PAUSE_LEN\r
+ pulse_len = A1TVBOX_BIT_PULSE_LEN;\r
+ pause_len = A1TVBOX_BIT_PAUSE_LEN;\r
+ has_stop_bit = A1TVBOX_STOP_BIT;\r
+ complete_data_len = A1TVBOX_COMPLETE_DATA_LEN + 1; // we send stop bit as data\r
+ n_auto_repetitions = 1; // 1 frame\r
+ auto_repetition_pause_len = 0;\r
+ repeat_frame_pause_len = A1TVBOX_FRAME_REPEAT_PAUSE_LEN;\r
+ irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_ROOMBA_PROTOCOL == 1\r
- case IRMP_ROOMBA_PROTOCOL:\r
- {\r
- startbit_pulse_len = ROOMBA_START_BIT_PULSE_LEN;\r
- startbit_pause_len = ROOMBA_START_BIT_PAUSE_LEN;\r
- pulse_1_len = ROOMBA_1_PULSE_LEN;\r
- pause_1_len = ROOMBA_1_PAUSE_LEN - 1;\r
- pulse_0_len = ROOMBA_0_PULSE_LEN;\r
- pause_0_len = ROOMBA_0_PAUSE_LEN - 1;\r
- has_stop_bit = ROOMBA_STOP_BIT;\r
- complete_data_len = ROOMBA_COMPLETE_DATA_LEN;\r
- n_auto_repetitions = ROOMBA_FRAMES; // 8 frames\r
- auto_repetition_pause_len = ROOMBA_FRAME_REPEAT_PAUSE_LEN;\r
- repeat_frame_pause_len = ROOMBA_FRAME_REPEAT_PAUSE_LEN;\r
- irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
- break;\r
- }\r
+ case IRMP_ROOMBA_PROTOCOL:\r
+ {\r
+ startbit_pulse_len = ROOMBA_START_BIT_PULSE_LEN;\r
+ startbit_pause_len = ROOMBA_START_BIT_PAUSE_LEN;\r
+ pulse_1_len = ROOMBA_1_PULSE_LEN;\r
+ pause_1_len = ROOMBA_1_PAUSE_LEN - 1;\r
+ pulse_0_len = ROOMBA_0_PULSE_LEN;\r
+ pause_0_len = ROOMBA_0_PAUSE_LEN - 1;\r
+ has_stop_bit = ROOMBA_STOP_BIT;\r
+ complete_data_len = ROOMBA_COMPLETE_DATA_LEN;\r
+ n_auto_repetitions = ROOMBA_FRAMES; // 8 frames\r
+ auto_repetition_pause_len = ROOMBA_FRAME_REPEAT_PAUSE_LEN;\r
+ repeat_frame_pause_len = ROOMBA_FRAME_REPEAT_PAUSE_LEN;\r
+ irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_PENTAX_PROTOCOL == 1\r
- case IRMP_PENTAX_PROTOCOL:\r
- {\r
- startbit_pulse_len = PENTAX_START_BIT_PULSE_LEN;\r
- startbit_pause_len = PENTAX_START_BIT_PAUSE_LEN;\r
- complete_data_len = PENTAX_COMPLETE_DATA_LEN;\r
- pulse_1_len = PENTAX_PULSE_LEN;\r
- pause_1_len = PENTAX_1_PAUSE_LEN - 1;\r
- pulse_0_len = PENTAX_PULSE_LEN;\r
- pause_0_len = PENTAX_0_PAUSE_LEN - 1;\r
- has_stop_bit = PENTAX_STOP_BIT;\r
- n_auto_repetitions = 1; // 1 frame\r
- auto_repetition_pause_len = 0;\r
- repeat_frame_pause_len = PENTAX_FRAME_REPEAT_PAUSE_LEN;\r
- irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
- break;\r
- }\r
+ case IRMP_PENTAX_PROTOCOL:\r
+ {\r
+ startbit_pulse_len = PENTAX_START_BIT_PULSE_LEN;\r
+ startbit_pause_len = PENTAX_START_BIT_PAUSE_LEN;\r
+ complete_data_len = PENTAX_COMPLETE_DATA_LEN;\r
+ pulse_1_len = PENTAX_PULSE_LEN;\r
+ pause_1_len = PENTAX_1_PAUSE_LEN - 1;\r
+ pulse_0_len = PENTAX_PULSE_LEN;\r
+ pause_0_len = PENTAX_0_PAUSE_LEN - 1;\r
+ has_stop_bit = PENTAX_STOP_BIT;\r
+ n_auto_repetitions = 1; // 1 frame\r
+ auto_repetition_pause_len = 0;\r
+ repeat_frame_pause_len = PENTAX_FRAME_REPEAT_PAUSE_LEN;\r
+ irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
+ break;\r
+ }\r
#endif\r
#if IRSND_SUPPORT_ACP24_PROTOCOL == 1\r
- case IRMP_ACP24_PROTOCOL:\r
- {\r
- startbit_pulse_len = ACP24_START_BIT_PULSE_LEN;\r
- startbit_pause_len = ACP24_START_BIT_PAUSE_LEN - 1;\r
- complete_data_len = ACP24_COMPLETE_DATA_LEN;\r
- pulse_1_len = ACP24_PULSE_LEN;\r
- pause_1_len = ACP24_1_PAUSE_LEN - 1;\r
- pulse_0_len = ACP24_PULSE_LEN;\r
- pause_0_len = ACP24_0_PAUSE_LEN - 1;\r
- has_stop_bit = ACP24_STOP_BIT;\r
- n_auto_repetitions = 1; // 1 frame\r
- auto_repetition_pause_len = 0;\r
- repeat_frame_pause_len = ACP24_FRAME_REPEAT_PAUSE_LEN;\r
- irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
- break;\r
- }\r
-#endif\r
- default:\r
- {\r
- irsnd_busy = FALSE;\r
- break;\r
- }\r
- }\r
- }\r
- }\r
-\r
- if (irsnd_busy)\r
- {\r
- new_frame = FALSE;\r
-\r
- switch (irsnd_protocol)\r
- {\r
+ case IRMP_ACP24_PROTOCOL:\r
+ {\r
+ startbit_pulse_len = ACP24_START_BIT_PULSE_LEN;\r
+ startbit_pause_len = ACP24_START_BIT_PAUSE_LEN - 1;\r
+ complete_data_len = ACP24_COMPLETE_DATA_LEN;\r
+ pulse_1_len = ACP24_PULSE_LEN;\r
+ pause_1_len = ACP24_1_PAUSE_LEN - 1;\r
+ pulse_0_len = ACP24_PULSE_LEN;\r
+ pause_0_len = ACP24_0_PAUSE_LEN - 1;\r
+ has_stop_bit = ACP24_STOP_BIT;\r
+ n_auto_repetitions = 1; // 1 frame\r
+ auto_repetition_pause_len = 0;\r
+ repeat_frame_pause_len = ACP24_FRAME_REPEAT_PAUSE_LEN;\r
+ irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
+ break;\r
+ }\r
+#endif\r
+ default:\r
+ {\r
+ irsnd_busy = FALSE;\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ if (irsnd_busy)\r
+ {\r
+ new_frame = FALSE;\r
+\r
+ switch (irsnd_protocol)\r
+ {\r
#if IRSND_SUPPORT_SIRCS_PROTOCOL == 1\r
- case IRMP_SIRCS_PROTOCOL:\r
+ case IRMP_SIRCS_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_NEC_PROTOCOL == 1\r
- case IRMP_NEC_PROTOCOL:\r
+ case IRMP_NEC_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_NEC16_PROTOCOL == 1\r
- case IRMP_NEC16_PROTOCOL:\r
+ case IRMP_NEC16_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_NEC42_PROTOCOL == 1\r
- case IRMP_NEC42_PROTOCOL:\r
+ case IRMP_NEC42_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_LGAIR_PROTOCOL == 1\r
- case IRMP_LGAIR_PROTOCOL:\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
+ case IRMP_SAMSUNG_PROTOCOL:\r
+ case IRMP_SAMSUNG32_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_SAMSUNG48_PROTOCOL == 1\r
- case IRMP_SAMSUNG48_PROTOCOL:\r
+ case IRMP_SAMSUNG48_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_MATSUSHITA_PROTOCOL == 1\r
- case IRMP_MATSUSHITA_PROTOCOL:\r
+ case IRMP_MATSUSHITA_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_MATSUSHITA_PROTOCOL == 1\r
- case IRMP_TECHNICS_PROTOCOL:\r
+ case IRMP_TECHNICS_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_KASEIKYO_PROTOCOL == 1\r
- case IRMP_KASEIKYO_PROTOCOL:\r
+ case IRMP_KASEIKYO_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_PANASONIC_PROTOCOL == 1\r
- case IRMP_PANASONIC_PROTOCOL:\r
+ case IRMP_PANASONIC_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_RECS80_PROTOCOL == 1\r
- case IRMP_RECS80_PROTOCOL:\r
+ case IRMP_RECS80_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_RECS80EXT_PROTOCOL == 1\r
- case IRMP_RECS80EXT_PROTOCOL:\r
+ case IRMP_RECS80EXT_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_TELEFUNKEN_PROTOCOL == 1\r
- case IRMP_TELEFUNKEN_PROTOCOL:\r
+ case IRMP_TELEFUNKEN_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_DENON_PROTOCOL == 1\r
- case IRMP_DENON_PROTOCOL:\r
+ case IRMP_DENON_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_BOSE_PROTOCOL == 1\r
- case IRMP_BOSE_PROTOCOL:\r
+ case IRMP_BOSE_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_NUBERT_PROTOCOL == 1\r
- case IRMP_NUBERT_PROTOCOL:\r
+ case IRMP_NUBERT_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_FAN_PROTOCOL == 1\r
- case IRMP_FAN_PROTOCOL:\r
+ case IRMP_FAN_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_SPEAKER_PROTOCOL == 1\r
- case IRMP_SPEAKER_PROTOCOL:\r
+ case IRMP_SPEAKER_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1\r
- case IRMP_BANG_OLUFSEN_PROTOCOL:\r
+ case IRMP_BANG_OLUFSEN_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_FDC_PROTOCOL == 1\r
- case IRMP_FDC_PROTOCOL:\r
+ case IRMP_FDC_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_RCCAR_PROTOCOL == 1\r
- case IRMP_RCCAR_PROTOCOL:\r
+ case IRMP_RCCAR_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_JVC_PROTOCOL == 1\r
- case IRMP_JVC_PROTOCOL:\r
+ case IRMP_JVC_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_NIKON_PROTOCOL == 1\r
- case IRMP_NIKON_PROTOCOL:\r
+ case IRMP_NIKON_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_LEGO_PROTOCOL == 1\r
- case IRMP_LEGO_PROTOCOL:\r
+ case IRMP_LEGO_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_THOMSON_PROTOCOL == 1\r
- case IRMP_THOMSON_PROTOCOL:\r
+ case IRMP_THOMSON_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_ROOMBA_PROTOCOL == 1\r
- case IRMP_ROOMBA_PROTOCOL:\r
+ case IRMP_ROOMBA_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_PENTAX_PROTOCOL == 1\r
- case IRMP_PENTAX_PROTOCOL:\r
+ case IRMP_PENTAX_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_ACP24_PROTOCOL == 1\r
- case IRMP_ACP24_PROTOCOL:\r
+ case IRMP_ACP24_PROTOCOL:\r
#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_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
IRSND_SUPPORT_LEGO_PROTOCOL == 1 || IRSND_SUPPORT_THOMSON_PROTOCOL == 1 || IRSND_SUPPORT_ROOMBA_PROTOCOL == 1 || IRSND_SUPPORT_TELEFUNKEN_PROTOCOL == 1 || \\r
- IRSND_SUPPORT_PENTAX_PROTOCOL == 1 || IRSND_SUPPORT_ACP24_PROTOCOL == 1 || IRSND_SUPPORT_PANASONIC_PROTOCOL == 1\r
- {\r
- if (pulse_counter == 0)\r
- {\r
- if (current_bit == 0xFF) // send start bit\r
- {\r
- pulse_len = startbit_pulse_len;\r
- pause_len = startbit_pause_len;\r
- }\r
- else if (current_bit < complete_data_len) // send n'th bit\r
- {\r
+ IRSND_SUPPORT_PENTAX_PROTOCOL == 1 || IRSND_SUPPORT_ACP24_PROTOCOL == 1 || IRSND_SUPPORT_PANASONIC_PROTOCOL == 1 || IRSND_SUPPORT_BOSE_PROTOCOL == 1\r
+ {\r
+ if (pulse_counter == 0)\r
+ {\r
+ if (current_bit == 0xFF) // send start bit\r
+ {\r
+ pulse_len = startbit_pulse_len;\r
+ pause_len = startbit_pause_len;\r
+ }\r
+ else if (current_bit < complete_data_len) // send n'th bit\r
+ {\r
#if IRSND_SUPPORT_SAMSUNG_PROTOCOL == 1\r
- if (irsnd_protocol == IRMP_SAMSUNG_PROTOCOL)\r
- {\r
- if (current_bit < SAMSUNG_ADDRESS_LEN) // send address bits\r
- {\r
- pulse_len = SAMSUNG_PULSE_LEN;\r
- pause_len = (irsnd_buffer[current_bit >> 3] & (1<<(7-(current_bit & 7)))) ?\r
- (SAMSUNG_1_PAUSE_LEN - 1) : (SAMSUNG_0_PAUSE_LEN - 1);\r
- }\r
- else if (current_bit == SAMSUNG_ADDRESS_LEN) // send SYNC bit (16th bit)\r
- {\r
- pulse_len = SAMSUNG_PULSE_LEN;\r
- pause_len = SAMSUNG_START_BIT_PAUSE_LEN - 1;\r
- }\r
- else if (current_bit < SAMSUNG_COMPLETE_DATA_LEN) // send n'th bit\r
- {\r
- uint8_t cur_bit = current_bit - 1; // sync skipped, offset = -1 !\r
-\r
- pulse_len = SAMSUNG_PULSE_LEN;\r
- pause_len = (irsnd_buffer[cur_bit >> 3] & (1<<(7-(cur_bit & 7)))) ?\r
- (SAMSUNG_1_PAUSE_LEN - 1) : (SAMSUNG_0_PAUSE_LEN - 1);\r
- }\r
- }\r
- else\r
+ if (irsnd_protocol == IRMP_SAMSUNG_PROTOCOL)\r
+ {\r
+ if (current_bit < SAMSUNG_ADDRESS_LEN) // send address bits\r
+ {\r
+ pulse_len = SAMSUNG_PULSE_LEN;\r
+ pause_len = (irsnd_buffer[current_bit >> 3] & (1<<(7-(current_bit & 7)))) ?\r
+ (SAMSUNG_1_PAUSE_LEN - 1) : (SAMSUNG_0_PAUSE_LEN - 1);\r
+ }\r
+ else if (current_bit == SAMSUNG_ADDRESS_LEN) // send SYNC bit (16th bit)\r
+ {\r
+ pulse_len = SAMSUNG_PULSE_LEN;\r
+ pause_len = SAMSUNG_START_BIT_PAUSE_LEN - 1;\r
+ }\r
+ else if (current_bit < SAMSUNG_COMPLETE_DATA_LEN) // send n'th bit\r
+ {\r
+ uint8_t cur_bit = current_bit - 1; // sync skipped, offset = -1 !\r
+\r
+ pulse_len = SAMSUNG_PULSE_LEN;\r
+ pause_len = (irsnd_buffer[cur_bit >> 3] & (1<<(7-(cur_bit & 7)))) ?\r
+ (SAMSUNG_1_PAUSE_LEN - 1) : (SAMSUNG_0_PAUSE_LEN - 1);\r
+ }\r
+ }\r
+ else\r
#endif\r
\r
#if IRSND_SUPPORT_NEC16_PROTOCOL == 1\r
- if (irsnd_protocol == IRMP_NEC16_PROTOCOL)\r
- {\r
- if (current_bit < NEC16_ADDRESS_LEN) // send address bits\r
- {\r
- pulse_len = NEC_PULSE_LEN;\r
- pause_len = (irsnd_buffer[current_bit >> 3] & (1<<(7-(current_bit & 7)))) ?\r
- (NEC_1_PAUSE_LEN - 1) : (NEC_0_PAUSE_LEN - 1);\r
- }\r
- else if (current_bit == NEC16_ADDRESS_LEN) // send SYNC bit (8th bit)\r
- {\r
- pulse_len = NEC_PULSE_LEN;\r
- pause_len = NEC_START_BIT_PAUSE_LEN - 1;\r
- }\r
- else if (current_bit < NEC16_COMPLETE_DATA_LEN + 1) // send n'th bit\r
- {\r
- uint8_t cur_bit = current_bit - 1; // sync skipped, offset = -1 !\r
-\r
- pulse_len = NEC_PULSE_LEN;\r
- pause_len = (irsnd_buffer[cur_bit >> 3] & (1<<(7-(cur_bit & 7)))) ?\r
- (NEC_1_PAUSE_LEN - 1) : (NEC_0_PAUSE_LEN - 1);\r
- }\r
- }\r
- else\r
+ if (irsnd_protocol == IRMP_NEC16_PROTOCOL)\r
+ {\r
+ if (current_bit < NEC16_ADDRESS_LEN) // send address bits\r
+ {\r
+ pulse_len = NEC_PULSE_LEN;\r
+ pause_len = (irsnd_buffer[current_bit >> 3] & (1<<(7-(current_bit & 7)))) ?\r
+ (NEC_1_PAUSE_LEN - 1) : (NEC_0_PAUSE_LEN - 1);\r
+ }\r
+ else if (current_bit == NEC16_ADDRESS_LEN) // send SYNC bit (8th bit)\r
+ {\r
+ pulse_len = NEC_PULSE_LEN;\r
+ pause_len = NEC_START_BIT_PAUSE_LEN - 1;\r
+ }\r
+ else if (current_bit < NEC16_COMPLETE_DATA_LEN + 1) // send n'th bit\r
+ {\r
+ uint8_t cur_bit = current_bit - 1; // sync skipped, offset = -1 !\r
+\r
+ pulse_len = NEC_PULSE_LEN;\r
+ pause_len = (irsnd_buffer[cur_bit >> 3] & (1<<(7-(cur_bit & 7)))) ?\r
+ (NEC_1_PAUSE_LEN - 1) : (NEC_0_PAUSE_LEN - 1);\r
+ }\r
+ }\r
+ else\r
#endif\r
\r
#if IRSND_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1\r
- if (irsnd_protocol == IRMP_BANG_OLUFSEN_PROTOCOL)\r
- {\r
- if (current_bit == 0) // send 2nd start bit\r
- {\r
- pulse_len = BANG_OLUFSEN_START_BIT2_PULSE_LEN;\r
- pause_len = BANG_OLUFSEN_START_BIT2_PAUSE_LEN - 1;\r
- }\r
- else if (current_bit == 1) // send 3rd start bit\r
- {\r
- pulse_len = BANG_OLUFSEN_START_BIT3_PULSE_LEN;\r
- pause_len = BANG_OLUFSEN_START_BIT3_PAUSE_LEN - 1;\r
- }\r
- else if (current_bit == 2) // send 4th start bit\r
- {\r
- pulse_len = BANG_OLUFSEN_START_BIT2_PULSE_LEN;\r
- pause_len = BANG_OLUFSEN_START_BIT2_PAUSE_LEN - 1;\r
- }\r
- else if (current_bit == 19) // send trailer bit\r
- {\r
- pulse_len = BANG_OLUFSEN_PULSE_LEN;\r
- pause_len = BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN - 1;\r
- }\r
- else if (current_bit < BANG_OLUFSEN_COMPLETE_DATA_LEN) // send n'th bit\r
- {\r
- uint8_t cur_bit_value = (irsnd_buffer[current_bit >> 3] & (1<<(7-(current_bit & 7)))) ? 1 : 0;\r
- pulse_len = BANG_OLUFSEN_PULSE_LEN;\r
-\r
- if (cur_bit_value == last_bit_value)\r
- {\r
- pause_len = BANG_OLUFSEN_R_PAUSE_LEN - 1;\r
- }\r
- else\r
- {\r
- pause_len = cur_bit_value ? (BANG_OLUFSEN_1_PAUSE_LEN - 1) : (BANG_OLUFSEN_0_PAUSE_LEN - 1);\r
- last_bit_value = cur_bit_value;\r
- }\r
- }\r
- }\r
- else\r
-#endif\r
- if (irsnd_buffer[current_bit >> 3] & (1<<(7-(current_bit & 7))))\r
- {\r
- pulse_len = pulse_1_len;\r
- pause_len = pause_1_len;\r
- }\r
- else\r
- {\r
- pulse_len = pulse_0_len;\r
- pause_len = pause_0_len;\r
- }\r
- }\r
- else if (has_stop_bit) // send stop bit\r
- {\r
- pulse_len = pulse_0_len;\r
-\r
- if (auto_repetition_counter < n_auto_repetitions)\r
- {\r
- pause_len = pause_0_len;\r
- }\r
- else\r
- {\r
- pause_len = 255; // last frame: pause of 255\r
- }\r
- }\r
- }\r
-\r
- if (pulse_counter < pulse_len)\r
- {\r
- if (pulse_counter == 0)\r
- {\r
- irsnd_on ();\r
- }\r
- pulse_counter++;\r
- }\r
- else if (pause_counter < pause_len)\r
- {\r
- if (pause_counter == 0)\r
- {\r
- irsnd_off ();\r
- }\r
- pause_counter++;\r
- }\r
- else\r
- {\r
- current_bit++;\r
-\r
- if (current_bit >= complete_data_len + has_stop_bit)\r
- {\r
- current_bit = 0xFF;\r
- auto_repetition_counter++;\r
-\r
- if (auto_repetition_counter == n_auto_repetitions)\r
- {\r
- irsnd_busy = FALSE;\r
- auto_repetition_counter = 0;\r
- }\r
- new_frame = TRUE;\r
- }\r
-\r
- pulse_counter = 0;\r
- pause_counter = 0;\r
- }\r
- break;\r
- }\r
+ if (irsnd_protocol == IRMP_BANG_OLUFSEN_PROTOCOL)\r
+ {\r
+ if (current_bit == 0) // send 2nd start bit\r
+ {\r
+ pulse_len = BANG_OLUFSEN_START_BIT2_PULSE_LEN;\r
+ pause_len = BANG_OLUFSEN_START_BIT2_PAUSE_LEN - 1;\r
+ }\r
+ else if (current_bit == 1) // send 3rd start bit\r
+ {\r
+ pulse_len = BANG_OLUFSEN_START_BIT3_PULSE_LEN;\r
+ pause_len = BANG_OLUFSEN_START_BIT3_PAUSE_LEN - 1;\r
+ }\r
+ else if (current_bit == 2) // send 4th start bit\r
+ {\r
+ pulse_len = BANG_OLUFSEN_START_BIT2_PULSE_LEN;\r
+ pause_len = BANG_OLUFSEN_START_BIT2_PAUSE_LEN - 1;\r
+ }\r
+ else if (current_bit == 19) // send trailer bit\r
+ {\r
+ pulse_len = BANG_OLUFSEN_PULSE_LEN;\r
+ pause_len = BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN - 1;\r
+ }\r
+ else if (current_bit < BANG_OLUFSEN_COMPLETE_DATA_LEN) // send n'th bit\r
+ {\r
+ uint8_t cur_bit_value = (irsnd_buffer[current_bit >> 3] & (1<<(7-(current_bit & 7)))) ? 1 : 0;\r
+ pulse_len = BANG_OLUFSEN_PULSE_LEN;\r
+\r
+ if (cur_bit_value == last_bit_value)\r
+ {\r
+ pause_len = BANG_OLUFSEN_R_PAUSE_LEN - 1;\r
+ }\r
+ else\r
+ {\r
+ pause_len = cur_bit_value ? (BANG_OLUFSEN_1_PAUSE_LEN - 1) : (BANG_OLUFSEN_0_PAUSE_LEN - 1);\r
+ last_bit_value = cur_bit_value;\r
+ }\r
+ }\r
+ }\r
+ else\r
+#endif\r
+ if (irsnd_buffer[current_bit >> 3] & (1<<(7-(current_bit & 7))))\r
+ {\r
+ pulse_len = pulse_1_len;\r
+ pause_len = pause_1_len;\r
+ }\r
+ else\r
+ {\r
+ pulse_len = pulse_0_len;\r
+ pause_len = pause_0_len;\r
+ }\r
+ }\r
+ else if (has_stop_bit) // send stop bit\r
+ {\r
+ pulse_len = pulse_0_len;\r
+\r
+ if (auto_repetition_counter < n_auto_repetitions)\r
+ {\r
+ pause_len = pause_0_len;\r
+ }\r
+ else\r
+ {\r
+ pause_len = 255; // last frame: pause of 255\r
+ }\r
+ }\r
+ }\r
+\r
+ if (pulse_counter < pulse_len)\r
+ {\r
+ if (pulse_counter == 0)\r
+ {\r
+ irsnd_on ();\r
+ }\r
+ pulse_counter++;\r
+ }\r
+ else if (pause_counter < pause_len)\r
+ {\r
+ if (pause_counter == 0)\r
+ {\r
+ irsnd_off ();\r
+ }\r
+ pause_counter++;\r
+ }\r
+ else\r
+ {\r
+ current_bit++;\r
+\r
+ if (current_bit >= complete_data_len + has_stop_bit)\r
+ {\r
+ current_bit = 0xFF;\r
+ auto_repetition_counter++;\r
+\r
+ if (auto_repetition_counter == n_auto_repetitions)\r
+ {\r
+ irsnd_busy = FALSE;\r
+ auto_repetition_counter = 0;\r
+ }\r
+ new_frame = TRUE;\r
+ }\r
+\r
+ pulse_counter = 0;\r
+ pause_counter = 0;\r
+ }\r
+ break;\r
+ }\r
#endif\r
\r
#if IRSND_SUPPORT_RC5_PROTOCOL == 1\r
- case IRMP_RC5_PROTOCOL:\r
+ case IRMP_RC5_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_RC6_PROTOCOL == 1\r
- case IRMP_RC6_PROTOCOL:\r
+ case IRMP_RC6_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_RC6A_PROTOCOL == 1\r
- case IRMP_RC6A_PROTOCOL:\r
+ case IRMP_RC6A_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_SIEMENS_PROTOCOL == 1\r
- case IRMP_SIEMENS_PROTOCOL:\r
+ case IRMP_SIEMENS_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_RUWIDO_PROTOCOL == 1\r
- case IRMP_RUWIDO_PROTOCOL:\r
+ case IRMP_RUWIDO_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_GRUNDIG_PROTOCOL == 1\r
- case IRMP_GRUNDIG_PROTOCOL:\r
+ case IRMP_GRUNDIG_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_IR60_PROTOCOL == 1\r
- case IRMP_IR60_PROTOCOL:\r
+ case IRMP_IR60_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_NOKIA_PROTOCOL == 1\r
- case IRMP_NOKIA_PROTOCOL:\r
+ case IRMP_NOKIA_PROTOCOL:\r
#endif\r
#if IRSND_SUPPORT_A1TVBOX_PROTOCOL == 1\r
- case IRMP_A1TVBOX_PROTOCOL:\r
+ case IRMP_A1TVBOX_PROTOCOL:\r
#endif\r
\r
#if IRSND_SUPPORT_RC5_PROTOCOL == 1 || \\r
IRSND_SUPPORT_IR60_PROTOCOL == 1 || \\r
IRSND_SUPPORT_NOKIA_PROTOCOL == 1 || \\r
IRSND_SUPPORT_A1TVBOX_PROTOCOL == 1\r
- {\r
- if (pulse_counter == pulse_len && pause_counter == pause_len)\r
- {\r
- current_bit++;\r
+ {\r
+ if (pulse_counter == pulse_len && pause_counter == pause_len)\r
+ {\r
+ current_bit++;\r
\r
- if (current_bit >= complete_data_len)\r
- {\r
- current_bit = 0xFF;\r
+ if (current_bit >= complete_data_len)\r
+ {\r
+ current_bit = 0xFF;\r
\r
#if IRSND_SUPPORT_GRUNDIG_PROTOCOL == 1 || IRSND_SUPPORT_IR60_PROTOCOL == 1 || IRSND_SUPPORT_NOKIA_PROTOCOL == 1\r
- if (irsnd_protocol == IRMP_GRUNDIG_PROTOCOL || irsnd_protocol == IRMP_IR60_PROTOCOL || irsnd_protocol == IRMP_NOKIA_PROTOCOL)\r
- {\r
- auto_repetition_counter++;\r
-\r
- if (repeat_counter > 0)\r
- { // set 117 msec pause time\r
- auto_repetition_pause_len = GRUNDIG_NOKIA_IR60_FRAME_REPEAT_PAUSE_LEN;\r
- }\r
-\r
- if (repeat_counter < n_repeat_frames) // tricky: repeat n info frames per auto repetition before sending last stop frame\r
- {\r
- n_auto_repetitions++; // increment number of auto repetitions\r
- repeat_counter++;\r
- }\r
- else if (auto_repetition_counter == n_auto_repetitions)\r
- {\r
- irsnd_busy = FALSE;\r
- auto_repetition_counter = 0;\r
- }\r
- }\r
- else\r
-#endif\r
- {\r
- irsnd_busy = FALSE;\r
- }\r
-\r
- new_frame = TRUE;\r
- irsnd_off ();\r
- }\r
-\r
- pulse_counter = 0;\r
- pause_counter = 0;\r
- }\r
-\r
- if (! new_frame)\r
- {\r
- uint8_t first_pulse;\r
+ if (irsnd_protocol == IRMP_GRUNDIG_PROTOCOL || irsnd_protocol == IRMP_IR60_PROTOCOL || irsnd_protocol == IRMP_NOKIA_PROTOCOL)\r
+ {\r
+ auto_repetition_counter++;\r
+\r
+ if (repeat_counter > 0)\r
+ { // set 117 msec pause time\r
+ auto_repetition_pause_len = GRUNDIG_NOKIA_IR60_FRAME_REPEAT_PAUSE_LEN;\r
+ }\r
+\r
+ if (repeat_counter < n_repeat_frames) // tricky: repeat n info frames per auto repetition before sending last stop frame\r
+ {\r
+ n_auto_repetitions++; // increment number of auto repetitions\r
+ repeat_counter++;\r
+ }\r
+ else if (auto_repetition_counter == n_auto_repetitions)\r
+ {\r
+ irsnd_busy = FALSE;\r
+ auto_repetition_counter = 0;\r
+ }\r
+ }\r
+ else\r
+#endif\r
+ {\r
+ irsnd_busy = FALSE;\r
+ }\r
+\r
+ new_frame = TRUE;\r
+ irsnd_off ();\r
+ }\r
+\r
+ pulse_counter = 0;\r
+ pause_counter = 0;\r
+ }\r
+\r
+ if (! new_frame)\r
+ {\r
+ uint8_t first_pulse;\r
\r
#if IRSND_SUPPORT_GRUNDIG_PROTOCOL == 1 || IRSND_SUPPORT_IR60_PROTOCOL == 1 || IRSND_SUPPORT_NOKIA_PROTOCOL == 1\r
- if (irsnd_protocol == IRMP_GRUNDIG_PROTOCOL || irsnd_protocol == IRMP_IR60_PROTOCOL || irsnd_protocol == IRMP_NOKIA_PROTOCOL)\r
- {\r
- if (current_bit == 0xFF || // start bit of start-frame\r
- (irsnd_protocol == IRMP_GRUNDIG_PROTOCOL && current_bit == 15) || // start bit of info-frame (Grundig)\r
- (irsnd_protocol == IRMP_IR60_PROTOCOL && current_bit == 7) || // start bit of data frame (IR60)\r
- (irsnd_protocol == IRMP_NOKIA_PROTOCOL && (current_bit == 23 || current_bit == 47))) // start bit of info- or stop-frame (Nokia)\r
- {\r
- pulse_len = startbit_pulse_len;\r
- pause_len = startbit_pause_len;\r
- first_pulse = TRUE;\r
- }\r
- else // send n'th bit\r
- {\r
- pulse_len = GRUNDIG_NOKIA_IR60_BIT_LEN;\r
- pause_len = GRUNDIG_NOKIA_IR60_BIT_LEN;\r
- first_pulse = (irsnd_buffer[current_bit >> 3] & (1<<(7-(current_bit & 7)))) ? TRUE : FALSE;\r
- }\r
- }\r
- else // if (irsnd_protocol == IRMP_RC5_PROTOCOL || irsnd_protocol == IRMP_RC6_PROTOCOL || irsnd_protocol == IRMP_RC6A_PROTOCOL ||\r
- // irsnd_protocol == IRMP_SIEMENS_PROTOCOL || irsnd_protocol == IRMP_RUWIDO_PROTOCOL)\r
-#endif\r
- {\r
- if (current_bit == 0xFF) // 1 start bit\r
- {\r
+ if (irsnd_protocol == IRMP_GRUNDIG_PROTOCOL || irsnd_protocol == IRMP_IR60_PROTOCOL || irsnd_protocol == IRMP_NOKIA_PROTOCOL)\r
+ {\r
+ if (current_bit == 0xFF || // start bit of start-frame\r
+ (irsnd_protocol == IRMP_GRUNDIG_PROTOCOL && current_bit == 15) || // start bit of info-frame (Grundig)\r
+ (irsnd_protocol == IRMP_IR60_PROTOCOL && current_bit == 7) || // start bit of data frame (IR60)\r
+ (irsnd_protocol == IRMP_NOKIA_PROTOCOL && (current_bit == 23 || current_bit == 47))) // start bit of info- or stop-frame (Nokia)\r
+ {\r
+ pulse_len = startbit_pulse_len;\r
+ pause_len = startbit_pause_len;\r
+ first_pulse = TRUE;\r
+ }\r
+ else // send n'th bit\r
+ {\r
+ pulse_len = GRUNDIG_NOKIA_IR60_BIT_LEN;\r
+ pause_len = GRUNDIG_NOKIA_IR60_BIT_LEN;\r
+ first_pulse = (irsnd_buffer[current_bit >> 3] & (1<<(7-(current_bit & 7)))) ? TRUE : FALSE;\r
+ }\r
+ }\r
+ else // if (irsnd_protocol == IRMP_RC5_PROTOCOL || irsnd_protocol == IRMP_RC6_PROTOCOL || irsnd_protocol == IRMP_RC6A_PROTOCOL ||\r
+ // irsnd_protocol == IRMP_SIEMENS_PROTOCOL || irsnd_protocol == IRMP_RUWIDO_PROTOCOL)\r
+#endif\r
+ {\r
+ if (current_bit == 0xFF) // 1 start bit\r
+ {\r
#if IRSND_SUPPORT_RC6_PROTOCOL == 1 || IRSND_SUPPORT_RC6A_PROTOCOL == 1\r
- if (irsnd_protocol == IRMP_RC6_PROTOCOL || irsnd_protocol == IRMP_RC6A_PROTOCOL)\r
- {\r
- pulse_len = startbit_pulse_len;\r
- pause_len = startbit_pause_len;\r
- }\r
- else\r
+ if (irsnd_protocol == IRMP_RC6_PROTOCOL || irsnd_protocol == IRMP_RC6A_PROTOCOL)\r
+ {\r
+ pulse_len = startbit_pulse_len;\r
+ pause_len = startbit_pause_len;\r
+ }\r
+ else\r
#endif\r
#if IRSND_SUPPORT_A1TVBOX_PROTOCOL == 1\r
- if (irsnd_protocol == IRMP_A1TVBOX_PROTOCOL)\r
- {\r
- current_bit = 0;\r
- }\r
- else\r
-#endif\r
- {\r
- ;\r
- }\r
-\r
- first_pulse = TRUE;\r
- }\r
- else // send n'th bit\r
- {\r
+ if (irsnd_protocol == IRMP_A1TVBOX_PROTOCOL)\r
+ {\r
+ current_bit = 0;\r
+ }\r
+ else\r
+#endif\r
+ {\r
+ ;\r
+ }\r
+\r
+ first_pulse = TRUE;\r
+ }\r
+ else // send n'th bit\r
+ {\r
#if IRSND_SUPPORT_RC6_PROTOCOL == 1 || IRSND_SUPPORT_RC6A_PROTOCOL == 1\r
- if (irsnd_protocol == IRMP_RC6_PROTOCOL || irsnd_protocol == IRMP_RC6A_PROTOCOL)\r
- {\r
- pulse_len = RC6_BIT_LEN;\r
- pause_len = RC6_BIT_LEN;\r
-\r
- if (irsnd_protocol == IRMP_RC6_PROTOCOL)\r
- {\r
- if (current_bit == 4) // toggle bit (double len)\r
- {\r
- pulse_len = RC6_BIT_2_LEN; // = 2 * RC_BIT_LEN\r
- pause_len = RC6_BIT_2_LEN; // = 2 * RC_BIT_LEN\r
- }\r
- }\r
- else // if (irsnd_protocol == IRMP_RC6A_PROTOCOL)\r
- {\r
- if (current_bit == 4) // toggle bit (double len)\r
- {\r
- pulse_len = RC6_BIT_3_LEN; // = 3 * RC6_BIT_LEN\r
- pause_len = RC6_BIT_2_LEN; // = 2 * RC6_BIT_LEN\r
- }\r
- else if (current_bit == 5) // toggle bit (double len)\r
- {\r
- pause_len = RC6_BIT_2_LEN; // = 2 * RC6_BIT_LEN\r
- }\r
- }\r
- }\r
-#endif\r
- first_pulse = (irsnd_buffer[current_bit >> 3] & (1<<(7-(current_bit & 7)))) ? TRUE : FALSE;\r
- }\r
-\r
- if (irsnd_protocol == IRMP_RC5_PROTOCOL)\r
- {\r
- first_pulse = first_pulse ? FALSE : TRUE;\r
- }\r
- }\r
-\r
- if (first_pulse)\r
- {\r
- // printf ("first_pulse: current_bit: %d %d < %d %d < %d\n", current_bit, pause_counter, pause_len, pulse_counter, pulse_len);\r
-\r
- if (pulse_counter < pulse_len)\r
- {\r
- if (pulse_counter == 0)\r
- {\r
- irsnd_on ();\r
- }\r
- pulse_counter++;\r
- }\r
- else // if (pause_counter < pause_len)\r
- {\r
- if (pause_counter == 0)\r
- {\r
- irsnd_off ();\r
- }\r
- pause_counter++;\r
- }\r
- }\r
- else\r
- {\r
- // printf ("first_pause: current_bit: %d %d < %d %d < %d\n", current_bit, pause_counter, pause_len, pulse_counter, pulse_len);\r
-\r
- if (pause_counter < pause_len)\r
- {\r
- if (pause_counter == 0)\r
- {\r
- irsnd_off ();\r
- }\r
- pause_counter++;\r
- }\r
- else // if (pulse_counter < pulse_len)\r
- {\r
- if (pulse_counter == 0)\r
- {\r
- irsnd_on ();\r
- }\r
- pulse_counter++;\r
- }\r
- }\r
- }\r
- break;\r
- }\r
+ if (irsnd_protocol == IRMP_RC6_PROTOCOL || irsnd_protocol == IRMP_RC6A_PROTOCOL)\r
+ {\r
+ pulse_len = RC6_BIT_LEN;\r
+ pause_len = RC6_BIT_LEN;\r
+\r
+ if (irsnd_protocol == IRMP_RC6_PROTOCOL)\r
+ {\r
+ if (current_bit == 4) // toggle bit (double len)\r
+ {\r
+ pulse_len = RC6_BIT_2_LEN; // = 2 * RC_BIT_LEN\r
+ pause_len = RC6_BIT_2_LEN; // = 2 * RC_BIT_LEN\r
+ }\r
+ }\r
+ else // if (irsnd_protocol == IRMP_RC6A_PROTOCOL)\r
+ {\r
+ if (current_bit == 4) // toggle bit (double len)\r
+ {\r
+ pulse_len = RC6_BIT_3_LEN; // = 3 * RC6_BIT_LEN\r
+ pause_len = RC6_BIT_2_LEN; // = 2 * RC6_BIT_LEN\r
+ }\r
+ else if (current_bit == 5) // toggle bit (double len)\r
+ {\r
+ pause_len = RC6_BIT_2_LEN; // = 2 * RC6_BIT_LEN\r
+ }\r
+ }\r
+ }\r
+#endif\r
+ first_pulse = (irsnd_buffer[current_bit >> 3] & (1<<(7-(current_bit & 7)))) ? TRUE : FALSE;\r
+ }\r
+\r
+ if (irsnd_protocol == IRMP_RC5_PROTOCOL)\r
+ {\r
+ first_pulse = first_pulse ? FALSE : TRUE;\r
+ }\r
+ }\r
+\r
+ if (first_pulse)\r
+ {\r
+ // printf ("first_pulse: current_bit: %d %d < %d %d < %d\n", current_bit, pause_counter, pause_len, pulse_counter, pulse_len);\r
+\r
+ if (pulse_counter < pulse_len)\r
+ {\r
+ if (pulse_counter == 0)\r
+ {\r
+ irsnd_on ();\r
+ }\r
+ pulse_counter++;\r
+ }\r
+ else // if (pause_counter < pause_len)\r
+ {\r
+ if (pause_counter == 0)\r
+ {\r
+ irsnd_off ();\r
+ }\r
+ pause_counter++;\r
+ }\r
+ }\r
+ else\r
+ {\r
+ // printf ("first_pause: current_bit: %d %d < %d %d < %d\n", current_bit, pause_counter, pause_len, pulse_counter, pulse_len);\r
+\r
+ if (pause_counter < pause_len)\r
+ {\r
+ if (pause_counter == 0)\r
+ {\r
+ irsnd_off ();\r
+ }\r
+ pause_counter++;\r
+ }\r
+ else // if (pulse_counter < pulse_len)\r
+ {\r
+ if (pulse_counter == 0)\r
+ {\r
+ irsnd_on ();\r
+ }\r
+ pulse_counter++;\r
+ }\r
+ }\r
+ }\r
+ break;\r
+ }\r
#endif // IRSND_SUPPORT_RC5_PROTOCOL == 1 || IRSND_SUPPORT_RC6_PROTOCOL == 1 || || IRSND_SUPPORT_RC6A_PROTOCOL == 1 || IRSND_SUPPORT_SIEMENS_PROTOCOL == 1 ||\r
// IRSND_SUPPORT_RUWIDO_PROTOCOL == 1 || IRSND_SUPPORT_GRUNDIG_PROTOCOL == 1 || IRSND_SUPPORT_IR60_PROTOCOL == 1 || IRSND_SUPPORT_NOKIA_PROTOCOL == 1\r
\r
- default:\r
- {\r
- irsnd_busy = FALSE;\r
- break;\r
- }\r
- }\r
- }\r
-\r
- if (! irsnd_busy)\r
- {\r
- if (repeat_counter < n_repeat_frames)\r
- {\r
+ default:\r
+ {\r
+ irsnd_busy = FALSE;\r
+ break;\r
+ }\r
+ }\r
+ }\r
+\r
+ if (! irsnd_busy)\r
+ {\r
+ if (repeat_counter < n_repeat_frames)\r
+ {\r
#if IRSND_SUPPORT_FDC_PROTOCOL == 1\r
- if (irsnd_protocol == IRMP_FDC_PROTOCOL)\r
- {\r
- irsnd_buffer[2] |= 0x0F;\r
- }\r
-#endif\r
- repeat_counter++;\r
- irsnd_busy = TRUE;\r
- }\r
- else\r
- {\r
- irsnd_busy = TRUE; //Rainer\r
- send_trailer = TRUE;\r
- n_repeat_frames = 0;\r
- repeat_counter = 0;\r
- }\r
- }\r
+ if (irsnd_protocol == IRMP_FDC_PROTOCOL)\r
+ {\r
+ irsnd_buffer[2] |= 0x0F;\r
+ }\r
+#endif\r
+ repeat_counter++;\r
+ irsnd_busy = TRUE;\r
+ }\r
+ else\r
+ {\r
+ irsnd_busy = TRUE; //Rainer\r
+ send_trailer = TRUE;\r
+ n_repeat_frames = 0;\r
+ repeat_counter = 0;\r
+ }\r
+ }\r
}\r
\r
#ifdef ANALYZE\r
if (irsnd_is_on)\r
{\r
- putchar ('0');\r
+ putchar ('0');\r
}\r
else\r
{\r
- putchar ('1');\r
+ putchar ('1');\r
}\r
#endif\r
\r
\r
if (argc != 4 && argc != 5)\r
{\r
- fprintf (stderr, "usage: %s protocol hex-address hex-command [repeat] > filename\n", argv[0]);\r
- return 1;\r
+ fprintf (stderr, "usage: %s protocol hex-address hex-command [repeat] > filename\n", argv[0]);\r
+ return 1;\r
}\r
\r
if (sscanf (argv[1], "%d", &protocol) == 1 &&\r
- sscanf (argv[2], "%x", &address) == 1 &&\r
- sscanf (argv[3], "%x", &command) == 1)\r
+ sscanf (argv[2], "%x", &address) == 1 &&\r
+ sscanf (argv[3], "%x", &command) == 1)\r
{\r
- irmp_data.protocol = protocol;\r
- irmp_data.address = address;\r
- irmp_data.command = command;\r
+ irmp_data.protocol = protocol;\r
+ irmp_data.address = address;\r
+ irmp_data.command = command;\r
\r
- if (argc == 5)\r
- {\r
- irmp_data.flags = atoi (argv[4]);\r
- }\r
- else\r
- {\r
- irmp_data.flags = 0;\r
- }\r
+ if (argc == 5)\r
+ {\r
+ irmp_data.flags = atoi (argv[4]);\r
+ }\r
+ else\r
+ {\r
+ irmp_data.flags = 0;\r
+ }\r
\r
- irsnd_init ();\r
+ irsnd_init ();\r
\r
- (void) irsnd_send_data (&irmp_data, TRUE);\r
+ (void) irsnd_send_data (&irmp_data, TRUE);\r
\r
- while (irsnd_busy)\r
- {\r
- irsnd_ISR ();\r
- }\r
+ while (irsnd_busy)\r
+ {\r
+ irsnd_ISR ();\r
+ }\r
\r
- putchar ('\n');\r
+ putchar ('\n');\r
\r
#if 1 // enable here to send twice\r
- (void) irsnd_send_data (&irmp_data, TRUE);\r
+ (void) irsnd_send_data (&irmp_data, TRUE);\r
\r
- while (irsnd_busy)\r
- {\r
- irsnd_ISR ();\r
- }\r
+ while (irsnd_busy)\r
+ {\r
+ irsnd_ISR ();\r
+ }\r
\r
- putchar ('\n');\r
+ putchar ('\n');\r
#endif\r
}\r
else\r
{\r
- fprintf (stderr, "%s: wrong arguments\n", argv[0]);\r
- return 1;\r
+ fprintf (stderr, "%s: wrong arguments\n", argv[0]);\r
+ return 1;\r
}\r
return 0;\r
}\r