]> cloudbase.mooo.com Git - irmp.git/blobdiff - irmp.c
Version 2.6.0: added SAMSUNG48 protocol (in IRSND).
[irmp.git] / irmp.c
diff --git a/irmp.c b/irmp.c
index 371e94ec00f01efefca5391bdc8457643d954c9f..851c270f63beb6976962bae3598495d92798815c 100644 (file)
--- a/irmp.c
+++ b/irmp.c
@@ -3,7 +3,7 @@
  *\r
  * Copyright (c) 2009-2013 Frank Meyer - frank(at)fli4l.de\r
  *\r
- * $Id: irmp.c,v 1.148 2014/05/30 12:48:54 fm Exp $\r
+ * $Id: irmp.c,v 1.159 2014/07/09 15:31:25 fm Exp $\r
  *\r
  * ATMEGA88 @ 8 MHz\r
  *\r
 static int                                      silent;\r
 static int                                      time_counter;\r
 static int                                      verbose;\r
+\r
+/*******************************                not every PIC compiler knows variadic macros :-(\r
 #else\r
 #  define ANALYZE_PUTCHAR(a)\r
 #  define ANALYZE_ONLY_NORMAL_PUTCHAR(a)\r
 #  define ANALYZE_PRINTF(...)\r
 #  define ANALYZE_ONLY_NORMAL_PRINTF(...)\r
+#  endif\r
 #  define ANALYZE_NEWLINE()\r
+*********************************/\r
 #endif\r
 \r
 #if IRMP_USE_CALLBACK == 1\r
@@ -537,6 +541,8 @@ irmp_protocol_names[IRMP_N_PROTOCOLS + 1] =
     "RCMM24",\r
     "RCMM12",\r
     "SPEAKER",\r
+    "LGAIR",\r
+    "SAMSG48",\r
     "RADIO1"\r
 };\r
 \r
@@ -548,13 +554,24 @@ irmp_protocol_names[IRMP_N_PROTOCOLS + 1] =
  */\r
 #if IRMP_LOGGING == 1                                               // logging via UART\r
 \r
-#if IRMP_EXT_LOGGING == 1                                           // use external logging\r
-#include "irmpextlog.h"\r
-#else                                                               // normal UART log (IRMP_EXT_LOGGING == 0)\r
-#define BAUD                                    9600L\r
-#ifndef UNIX_OR_WINDOWS\r
-#include <util/setbaud.h>\r
-#endif\r
+#if defined(ARM_STM32F4XX)\r
+#  define  STM32_GPIO_CLOCK   RCC_AHB1Periph_GPIOA                    // per UART2 an PA2\r
+#  define  STM32_UART_CLOCK   RCC_APB1Periph_USART2\r
+#  define  STM32_GPIO_PORT    GPIOA\r
+#  define  STM32_GPIO_PIN     GPIO_Pin_2\r
+#  define  STM32_GPIO_SOURCE  GPIO_PinSource2\r
+#  define  STM32_UART_AF      GPIO_AF_USART2\r
+#  define  STM32_UART_COM     USART2\r
+#  define  STM32_UART_BAUD    115200                                  // mit 115200 Baud\r
+#  include "stm32f4xx_usart.h"\r
+#else\r
+#  if IRMP_EXT_LOGGING == 1                                           // use external logging\r
+#    include "irmpextlog.h"\r
+#  else                                                               // normal UART log (IRMP_EXT_LOGGING == 0)\r
+#    define BAUD                                    9600L\r
+#  ifndef UNIX_OR_WINDOWS\r
+#    include <util/setbaud.h>\r
+#  endif\r
 \r
 #ifdef UBRR0H\r
 \r
@@ -596,6 +613,7 @@ irmp_protocol_names[IRMP_N_PROTOCOLS + 1] =
 \r
 #endif //UBRR0H\r
 #endif //IRMP_EXT_LOGGING\r
+#endif //ARM_STM32F4XX\r
 \r
 /*---------------------------------------------------------------------------------------------------------------------------------------------------\r
  *  Initialize  UART\r
@@ -606,6 +624,45 @@ void
 irmp_uart_init (void)\r
 {\r
 #ifndef UNIX_OR_WINDOWS\r
+#if defined(ARM_STM32F4XX)\r
+    GPIO_InitTypeDef GPIO_InitStructure;\r
+    USART_InitTypeDef USART_InitStructure;\r
+\r
+    // Clock enable vom TX Pin\r
+    RCC_AHB1PeriphClockCmd(STM32_GPIO_CLOCK, ENABLE);\r
+\r
+    // Clock enable der UART\r
+    RCC_APB1PeriphClockCmd(STM32_UART_CLOCK, ENABLE);\r
+\r
+    // UART Alternative-Funktion mit dem IO-Pin verbinden\r
+    GPIO_PinAFConfig(STM32_GPIO_PORT,STM32_GPIO_SOURCE,STM32_UART_AF);\r
+\r
+    // UART als Alternative-Funktion mit PushPull\r
+    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;\r
+    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;\r
+    GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;\r
+    GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;\r
+\r
+    // TX-Pin\r
+    GPIO_InitStructure.GPIO_Pin = STM32_GPIO_PIN;\r
+    GPIO_Init(STM32_GPIO_PORT, &GPIO_InitStructure);\r
+\r
+    // Oversampling\r
+    USART_OverSampling8Cmd(STM32_UART_COM, ENABLE);\r
+\r
+    // init mit Baudrate, 8Databits, 1Stopbit, keine Parität, kein RTS+CTS\r
+    USART_InitStructure.USART_BaudRate = STM32_UART_BAUD;\r
+    USART_InitStructure.USART_WordLength = USART_WordLength_8b;\r
+    USART_InitStructure.USART_StopBits = USART_StopBits_1;\r
+    USART_InitStructure.USART_Parity = USART_Parity_No;\r
+    USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;\r
+    USART_InitStructure.USART_Mode = USART_Mode_Tx;\r
+    USART_Init(STM32_UART_COM, &USART_InitStructure);\r
+\r
+    // UART enable\r
+    USART_Cmd(STM32_UART_COM, ENABLE);\r
+\r
+#else\r
 #if (IRMP_EXT_LOGGING == 0)                                                                         // use UART\r
     UART0_UBRRH = UBRRH_VALUE;                                                                      // set baud rate\r
     UART0_UBRRL = UBRRL_VALUE;\r
@@ -619,8 +676,9 @@ irmp_uart_init (void)
     UART0_UCSRC = UART0_UCSZ1_BIT_VALUE | UART0_UCSZ0_BIT_VALUE | UART0_URSEL_BIT_VALUE;\r
     UART0_UCSRB |= UART0_TXEN_BIT_VALUE;                                                            // enable UART TX\r
 #else                                                                                               // other log method\r
-        initextlog();                                                         \r
+    initextlog();                                                         \r
 #endif //IRMP_EXT_LOGGING\r
+#endif //ARM_STM32F4XX\r
 #endif // UNIX_OR_WINDOWS\r
 }\r
 \r
@@ -634,16 +692,37 @@ void
 irmp_uart_putc (unsigned char ch)\r
 {\r
 #ifndef UNIX_OR_WINDOWS\r
+#if defined(ARM_STM32F4XX)\r
+    // warten bis altes Byte gesendet wurde\r
+    while (USART_GetFlagStatus(STM32_UART_COM, USART_FLAG_TXE) == RESET)\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
+    }\r
+\r
+#else\r
 #if (IRMP_EXT_LOGGING == 0)\r
+\r
     while (!(UART0_UCSRA & UART0_UDRE_BIT_VALUE))\r
     {\r
         ;\r
     }\r
 \r
     UART0_UDR = ch;\r
+\r
 #else\r
-    sendextlog(ch); //Use external log\r
-#endif\r
+\r
+    sendextlog(ch);                                                         // use external log\r
+\r
+#endif //IRMP_EXT_LOGGING\r
+#endif //ARM_STM32F4XX\r
 #else\r
     fputc (ch, stderr);\r
 #endif // UNIX_OR_WINDOWS\r
@@ -942,6 +1021,31 @@ static const PROGMEM IRMP_PARAMETER nec42_param =
 \r
 #endif\r
 \r
+#if IRMP_SUPPORT_LGAIR_PROTOCOL == 1\r
+\r
+static const PROGMEM IRMP_PARAMETER lgair_param =\r
+{\r
+    IRMP_LGAIR_PROTOCOL,                                                // protocol:        ir protocol\r
+    NEC_PULSE_LEN_MIN,                                                  // pulse_1_len_min: minimum length of pulse with bit value 1\r
+    NEC_PULSE_LEN_MAX,                                                  // pulse_1_len_max: maximum length of pulse with bit value 1\r
+    NEC_1_PAUSE_LEN_MIN,                                                // pause_1_len_min: minimum length of pause with bit value 1\r
+    NEC_1_PAUSE_LEN_MAX,                                                // pause_1_len_max: maximum length of pause with bit value 1\r
+    NEC_PULSE_LEN_MIN,                                                  // pulse_0_len_min: minimum length of pulse with bit value 0\r
+    NEC_PULSE_LEN_MAX,                                                  // pulse_0_len_max: maximum length of pulse with bit value 0\r
+    NEC_0_PAUSE_LEN_MIN,                                                // pause_0_len_min: minimum length of pause with bit value 0\r
+    NEC_0_PAUSE_LEN_MAX,                                                // pause_0_len_max: maximum length of pause with bit value 0\r
+    LGAIR_ADDRESS_OFFSET,                                               // address_offset:  address offset\r
+    LGAIR_ADDRESS_OFFSET + LGAIR_ADDRESS_LEN,                           // address_end:     end of address\r
+    LGAIR_COMMAND_OFFSET,                                               // command_offset:  command offset\r
+    LGAIR_COMMAND_OFFSET + LGAIR_COMMAND_LEN,                           // command_end:     end of command\r
+    LGAIR_COMPLETE_DATA_LEN,                                            // complete_len:    complete length of frame\r
+    NEC_STOP_BIT,                                                       // stop_bit:        flag: frame has stop bit\r
+    NEC_LSB,                                                            // lsb_first:       flag: LSB first\r
+    NEC_FLAGS                                                           // flags:           some flags\r
+};\r
+\r
+#endif\r
+\r
 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1\r
 \r
 static const PROGMEM IRMP_PARAMETER samsung_param =\r
@@ -1724,7 +1828,15 @@ irmp_get_data (IRMP_DATA * irmp_data_p)
                     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
 #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
@@ -1734,7 +1846,9 @@ irmp_get_data (IRMP_DATA * irmp_data_p)
                 }\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
@@ -1783,7 +1897,9 @@ irmp_get_data (IRMP_DATA * irmp_data_p)
                 }\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
@@ -1818,12 +1934,16 @@ irmp_get_data (IRMP_DATA * irmp_data_p)
                     }\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
@@ -1839,7 +1959,9 @@ irmp_get_data (IRMP_DATA * irmp_data_p)
                 }\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
@@ -1888,11 +2010,16 @@ irmp_set_callback_ptr (void (*cb)(uint8_t))
 static uint16_t irmp_tmp_address;                                                       // ir address\r
 static uint16_t irmp_tmp_command;                                                       // ir command\r
 \r
-#if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1) || IRMP_SUPPORT_NEC42_PROTOCOL == 1\r
+#if (IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)) || IRMP_SUPPORT_NEC42_PROTOCOL == 1\r
 static uint16_t irmp_tmp_address2;                                                      // ir address\r
 static uint16_t irmp_tmp_command2;                                                      // ir command\r
 #endif\r
 \r
+#if IRMP_SUPPORT_LGAIR_PROTOCOL == 1\r
+static uint16_t irmp_lgair_address;                                                     // ir address\r
+static uint16_t irmp_lgair_command;                                                     // ir command\r
+#endif\r
+\r
 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1\r
 static uint16_t irmp_tmp_id;                                                            // ir id (only SAMSUNG)\r
 #endif\r
@@ -1979,7 +2106,16 @@ irmp_store_bit (uint8_t value)
     {\r
         if (irmp_param.lsb_first)\r
         {\r
-            irmp_tmp_command |= (((uint16_t) (value)) << (irmp_bit - irmp_param.command_offset));   // CV wants cast\r
+#if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1\r
+            if (irmp_param.protocol == IRMP_SAMSUNG48_PROTOCOL && irmp_bit >= 32)\r
+            {\r
+                irmp_tmp_id |= (((uint16_t) (value)) << (irmp_bit - 32));   // CV wants cast\r
+            }\r
+            else\r
+#endif\r
+            {\r
+                irmp_tmp_command |= (((uint16_t) (value)) << (irmp_bit - irmp_param.command_offset));   // CV wants cast\r
+            }\r
         }\r
         else\r
         {\r
@@ -1988,6 +2124,23 @@ irmp_store_bit (uint8_t value)
         }\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
+    }\r
+    // NO else!\r
+#endif\r
+\r
 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1\r
     if (irmp_param.protocol == IRMP_NEC42_PROTOCOL && irmp_bit >= 13 && irmp_bit < 26)\r
     {\r
@@ -2103,7 +2256,7 @@ irmp_ISR (void)
 \r
 #ifdef ANALYZE\r
     time_counter++;\r
-#endif\r
+#endif // ANALYZE\r
 \r
     irmp_input = input(IRMP_PIN);\r
 \r
@@ -2134,7 +2287,7 @@ irmp_ISR (void)
                 {\r
                     ANALYZE_PRINTF("%8.3fms [starting pulse]\n", (double) (time_counter * 1000) / F_INTERRUPTS);\r
                 }\r
-#endif\r
+#endif // ANALYZE\r
                 irmp_pulse_time++;                                              // increment counter\r
             }\r
             else\r
@@ -2149,12 +2302,18 @@ irmp_ISR (void)
 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1\r
                     genre2                  = 0;\r
 #endif\r
+#if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1\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
 #endif\r
-\r
+#if IRMP_SUPPORT_LGAIR_PROTOCOL == 1\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
 #if IRMP_SUPPORT_RC5_PROTOCOL == 1\r
@@ -2174,8 +2333,10 @@ irmp_ISR (void)
 \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
+#endif // ANALYZE\r
                                 last_irmp_denon_command = 0;\r
                                 denon_repetition_len = 0xFFFF;\r
                             }\r
@@ -2208,10 +2369,12 @@ irmp_ISR (void)
                         else\r
 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1\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
+#endif // ANALYZE\r
                         }\r
-//                      irmp_busy_flag = FALSE;\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
@@ -2225,15 +2388,19 @@ irmp_ISR (void)
                     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
+#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
+#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
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) (IRMP_PARAMETER *) &sircs_param;\r
                     }\r
                     else\r
@@ -2244,9 +2411,11 @@ irmp_ISR (void)
                         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
@@ -2257,17 +2426,20 @@ irmp_ISR (void)
                         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
+#endif // ANALYZE\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
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &nec_param;\r
 #endif\r
-\r
                     }\r
                     else if (irmp_pulse_time >= NEC_START_BIT_PULSE_LEN_MIN        && irmp_pulse_time <= NEC_START_BIT_PULSE_LEN_MAX &&\r
                              irmp_pause_time >= NEC_REPEAT_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= NEC_REPEAT_START_BIT_PAUSE_LEN_MAX)\r
@@ -2275,17 +2447,21 @@ irmp_ISR (void)
 #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
+#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
+#endif // ANALYZE\r
                             irmp_param_p = (IRMP_PARAMETER *) &nec_param;\r
                         }\r
                         else\r
 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1\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
+#endif // ANALYZE\r
 \r
                             irmp_param_p = (IRMP_PARAMETER *) &nec_rep_param;\r
                         }\r
@@ -2297,9 +2473,11 @@ irmp_ISR (void)
                         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
@@ -2311,9 +2489,11 @@ irmp_ISR (void)
                     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
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &telefunken_param;\r
                     }\r
                     else\r
@@ -2323,9 +2503,11 @@ irmp_ISR (void)
                     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
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &roomba_param;\r
                     }\r
                     else\r
@@ -2335,9 +2517,11 @@ irmp_ISR (void)
                     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
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &nikon_param;\r
                     }\r
                     else\r
@@ -2347,9 +2531,11 @@ irmp_ISR (void)
                     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
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &samsung_param;\r
                     }\r
                     else\r
@@ -2359,9 +2545,11 @@ irmp_ISR (void)
                     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
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &matsushita_param;\r
                     }\r
                     else\r
@@ -2371,9 +2559,11 @@ irmp_ISR (void)
                     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
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &kaseikyo_param;\r
                     }\r
                     else\r
@@ -2383,9 +2573,11 @@ irmp_ISR (void)
                     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
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &radio1_param;\r
                     }\r
                     else\r
@@ -2395,9 +2587,11 @@ irmp_ISR (void)
                     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
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &recs80_param;\r
                     }\r
                     else\r
@@ -2413,6 +2607,7 @@ irmp_ISR (void)
                         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
@@ -2420,6 +2615,7 @@ irmp_ISR (void)
                             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
@@ -2429,6 +2625,7 @@ irmp_ISR (void)
                         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
@@ -2436,16 +2633,19 @@ irmp_ISR (void)
                             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
@@ -2470,10 +2670,12 @@ irmp_ISR (void)
                         ((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
@@ -2484,10 +2686,12 @@ irmp_ISR (void)
                         ((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
@@ -2497,9 +2701,11 @@ irmp_ISR (void)
                     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
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &bose_param;\r
                     }\r
                     else\r
@@ -2509,9 +2715,11 @@ irmp_ISR (void)
                     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
@@ -2523,9 +2731,11 @@ irmp_ISR (void)
                     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
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &recs80ext_param;\r
                     }\r
                     else\r
@@ -2535,9 +2745,11 @@ irmp_ISR (void)
                     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
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &nubert_param;\r
                     }\r
                     else\r
@@ -2547,9 +2759,11 @@ irmp_ISR (void)
                     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
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &speaker_param;\r
                     }\r
                     else\r
@@ -2559,6 +2773,7 @@ irmp_ISR (void)
                     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
@@ -2572,6 +2787,7 @@ irmp_ISR (void)
                         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
@@ -2582,9 +2798,11 @@ irmp_ISR (void)
                     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
@@ -2598,11 +2816,13 @@ irmp_ISR (void)
                         ((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
@@ -2614,9 +2834,11 @@ irmp_ISR (void)
                     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
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &fdc_param;\r
                     }\r
                     else\r
@@ -2626,9 +2848,11 @@ irmp_ISR (void)
                     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
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &rccar_param;\r
                     }\r
                     else\r
@@ -2638,9 +2862,11 @@ irmp_ISR (void)
                     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
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &kathrein_param;\r
                     }\r
                     else\r
@@ -2650,9 +2876,11 @@ irmp_ISR (void)
                     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
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &netbox_param;\r
                     }\r
                     else\r
@@ -2662,9 +2890,11 @@ irmp_ISR (void)
                     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
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &lego_param;\r
                     }\r
                     else\r
@@ -2674,9 +2904,11 @@ irmp_ISR (void)
                     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
@@ -2688,9 +2920,11 @@ irmp_ISR (void)
                     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
@@ -2703,16 +2937,19 @@ irmp_ISR (void)
                     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
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &rcmm_param;\r
                     }\r
                     else\r
 #endif // IRMP_SUPPORT_RCMM_PROTOCOL == 1\r
                     {\r
+#ifdef ANALYZE\r
                         ANALYZE_PRINTF ("protocol = UNKNOWN\n");\r
-//                      irmp_busy_flag = FALSE;\r
+#endif // ANALYZE\r
                         irmp_start_bit_detected = 0;                            // wait for another start bit...\r
                     }\r
 \r
@@ -2720,27 +2957,32 @@ irmp_ISR (void)
                     {\r
                         memcpy_P (&irmp_param, irmp_param_p, sizeof (IRMP_PARAMETER));\r
 \r
-#ifdef ANALYZE\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
+#endif // ANALYZE\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
+#endif // ANALYZE\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
+#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
+#endif // ANALYZE\r
                         }\r
 #endif\r
 \r
@@ -2748,23 +2990,30 @@ irmp_ISR (void)
 #if IRMP_SUPPORT_RC6_PROTOCOL == 1\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
+#endif // ANALYZE\r
                         }\r
 #endif\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
+#endif // ANALYZE\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
+#endif // ANALYZE\r
                         }\r
 \r
+#ifdef ANALYZE\r
 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1\r
                         if (irmp_param.protocol == IRMP_BANG_OLUFSEN_PROTOCOL)\r
                         {\r
@@ -2789,17 +3038,20 @@ irmp_ISR (void)
                     {\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
-\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
@@ -2818,19 +3070,25 @@ irmp_ISR (void)
 #if IRMP_SUPPORT_DENON_PROTOCOL == 1\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
+#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
-                          ANALYZE_PUTCHAR ('1');                                  // yes, store 1\r
-                          ANALYZE_NEWLINE ();\r
-                          irmp_store_bit (1);\r
+#ifdef ANALYZE\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
-                          ANALYZE_PUTCHAR ('0');                                  // yes, store 0\r
-                          ANALYZE_NEWLINE ();\r
-                          irmp_store_bit (0);\r
+#ifdef ANALYZE\r
+                            ANALYZE_PUTCHAR ('0');                                  // yes, store 0\r
+                            ANALYZE_NEWLINE ();\r
+#endif // ANALYZE\r
+                            irmp_store_bit (0);\r
                         }\r
                     }\r
                     else\r
@@ -2838,18 +3096,24 @@ irmp_ISR (void)
 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1\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
+#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
+#ifdef ANALYZE\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
+#ifdef ANALYZE\r
                           ANALYZE_PUTCHAR ('0');                                  // yes, store 0\r
                           ANALYZE_NEWLINE ();\r
+#endif // ANALYZE\r
                           irmp_store_bit (0);\r
                         }\r
                     }\r
@@ -2886,15 +3150,15 @@ irmp_ISR (void)
                             {\r
                                 ANALYZE_PRINTF ("stop bit detected\n");\r
                             }\r
-#endif\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
-\r
-//                          irmp_busy_flag = FALSE;\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
@@ -2931,7 +3195,9 @@ irmp_ISR (void)
                         {\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
@@ -2953,7 +3219,9 @@ irmp_ISR (void)
                             }\r
                             else if (irmp_bit >= GRUNDIG_COMPLETE_DATA_LEN)\r
                             {\r
+#ifdef ANALYZE\r
                                 ANALYZE_PRINTF ("Switching to NOKIA protocol\n");\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
@@ -2980,7 +3248,9 @@ irmp_ISR (void)
                             }\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
@@ -3034,7 +3304,9 @@ irmp_ISR (void)
 #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
@@ -3043,12 +3315,28 @@ irmp_ISR (void)
                                 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
+#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
+                            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
+#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
@@ -3060,10 +3348,25 @@ irmp_ISR (void)
                                 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
+#ifdef ANALYZE\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
+#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
+#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
@@ -3076,6 +3379,20 @@ irmp_ISR (void)
                             }\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
+#ifdef ANALYZE\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
+#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
@@ -3084,12 +3401,16 @@ irmp_ISR (void)
                                     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
+#endif // ANALYZE\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
+#endif // ANALYZE\r
                                     irmp_param.protocol     = IRMP_RCMM24_PROTOCOL;                 // switch protocol\r
                                 }\r
                                 irmp_param.stop_bit     = TRUE;                                     // set flag\r
@@ -3098,10 +3419,10 @@ irmp_ISR (void)
 #endif // IRMP_SUPPORT_RCMM_PROTOCOL == 1\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
-\r
-//                              irmp_busy_flag = FALSE;\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
@@ -3116,7 +3437,9 @@ irmp_ISR (void)
 \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
+#endif // ANALYZE\r
 \r
 #if IRMP_SUPPORT_MANCHESTER == 1\r
                     if ((irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER))                                     // Manchester\r
@@ -3131,7 +3454,9 @@ irmp_ISR (void)
 #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
@@ -3142,18 +3467,24 @@ irmp_ISR (void)
                                     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
+#ifdef ANALYZE\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
 \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
                                     irmp_store_bit (1);\r
 \r
                                     if (irmp_pause_time > 2 * irmp_param.pause_1_len_max)\r
@@ -3164,18 +3495,24 @@ irmp_ISR (void)
                                     {\r
                                         last_value = 1;\r
                                     }\r
+#ifdef ANALYZE\r
                                     ANALYZE_NEWLINE ();\r
+#endif // ANALYZE\r
                                 }\r
                                 else\r
 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1\r
                                 {\r
+#ifdef ANALYZE\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
 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)\r
                                     if (! irmp_param2.protocol)\r
 #endif\r
                                     {\r
+#ifdef ANALYZE\r
                                         ANALYZE_NEWLINE ();\r
+#endif // ANALYZE\r
                                     }\r
                                     last_value = (irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? 1 : 0;\r
                                 }\r
@@ -3196,19 +3533,25 @@ irmp_ISR (void)
                                 manchester_value = last_value;\r
                             }\r
 \r
+#ifdef ANALYZE\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
 #endif\r
                             {\r
+#ifdef ANALYZE\r
                                 ANALYZE_NEWLINE ();\r
+#endif // ANALYZE\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
@@ -3228,7 +3571,9 @@ irmp_ISR (void)
                                 ((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
+#endif // ANALYZE\r
                                 irmp_param.protocol = 0;                // switch to FDC, see below\r
                             }\r
                             else\r
@@ -3239,17 +3584,20 @@ irmp_ISR (void)
                                 ((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
+#endif // ANALYZE\r
                                 irmp_param.protocol = 0;                // switch to RCCAR, see below\r
                             }\r
                             else\r
 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1\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
-//                              irmp_busy_flag = FALSE;\r
+#endif // ANALYZE\r
                                 irmp_start_bit_detected = 0;                            // reset flags and wait for next start bit\r
                                 irmp_pause_time         = 0;\r
                             }\r
@@ -3260,18 +3608,24 @@ irmp_ISR (void)
                         {\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
+#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
+#ifdef ANALYZE\r
                                 ANALYZE_PRINTF ("   0 (FDC)\n");\r
+#endif // ANALYZE\r
                                 irmp_store_bit2 (0);\r
                             }\r
 \r
                             if (! irmp_param.protocol)\r
                             {\r
+#ifdef ANALYZE\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
@@ -3284,18 +3638,24 @@ irmp_ISR (void)
                         {\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
+#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
+#ifdef ANALYZE\r
                                 ANALYZE_PRINTF ("   0 (RCCAR)\n");\r
+#endif // ANALYZE\r
                                 irmp_store_bit2 (0);\r
                             }\r
 \r
                             if (! irmp_param.protocol)\r
                             {\r
+#ifdef ANALYZE\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
@@ -3315,7 +3675,9 @@ irmp_ISR (void)
                     {\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
@@ -3330,7 +3692,9 @@ irmp_ISR (void)
 \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
@@ -3342,7 +3706,9 @@ irmp_ISR (void)
                                 irmp_pause_time = 0;\r
                             }\r
                         }\r
+#ifdef ANALYZE\r
                         ANALYZE_NEWLINE ();\r
+#endif // ANALYZE\r
                         wait_for_space = 0;\r
                     }\r
                     else\r
@@ -3354,40 +3720,56 @@ irmp_ISR (void)
                         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_tmp_id = 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
+#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
+#else\r
+#ifdef ANALYZE\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
-\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
-                            ANALYZE_PRINTF ("Switching to SAMSUNG32 protocol\n");\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
-//                          irmp_busy_flag = FALSE;\r
+#endif // ANALYZE\r
                             irmp_start_bit_detected = 0;                            // reset flags and wait for next start bit\r
                             irmp_pause_time         = 0;\r
                         }\r
@@ -3403,7 +3785,9 @@ irmp_ISR (void)
 #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
@@ -3424,15 +3808,18 @@ irmp_ISR (void)
                             {\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
-//                                  irmp_busy_flag = FALSE;\r
+#endif // ANALYZE\r
                                     irmp_start_bit_detected = 0;                    // reset flags and wait for next start bit\r
                                     irmp_pause_time         = 0;\r
                                 }\r
@@ -3441,15 +3828,18 @@ irmp_ISR (void)
                             {\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
-//                                  irmp_busy_flag = FALSE;\r
+#endif // ANALYZE\r
                                     irmp_start_bit_detected = 0;                    // reset flags and wait for next start bit\r
                                     irmp_pause_time         = 0;\r
                                 }\r
@@ -3458,32 +3848,39 @@ irmp_ISR (void)
                             {\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
-//                                  irmp_busy_flag = FALSE;\r
+#endif // ANALYZE\r
                                     irmp_start_bit_detected = 0;                    // reset flags and wait for next start bit\r
                                     irmp_pause_time         = 0;\r
                                 }\r
@@ -3491,9 +3888,10 @@ irmp_ISR (void)
                         }\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
-//                          irmp_busy_flag = FALSE;\r
+#endif // ANALYZE\r
                             irmp_start_bit_detected = 0;                            // reset flags and wait for next start bit\r
                             irmp_pause_time         = 0;\r
                         }\r
@@ -3506,33 +3904,43 @@ irmp_ISR (void)
                     {\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
@@ -3541,16 +3949,20 @@ irmp_ISR (void)
                     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
+#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
+#ifdef ANALYZE\r
                         ANALYZE_PUTCHAR ('0');\r
                         ANALYZE_NEWLINE ();\r
+#endif // ANALYZE\r
                         irmp_store_bit (0);\r
                         wait_for_space = 0;\r
                     }\r
@@ -3568,14 +3980,18 @@ irmp_ISR (void)
                         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
@@ -3583,9 +3999,10 @@ irmp_ISR (void)
                     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
-//                      irmp_busy_flag = FALSE;\r
+#endif // ANALYZE\r
                         irmp_start_bit_detected = 0;                                // reset flags and wait for next start bit\r
                         irmp_pause_time         = 0;\r
                     }\r
@@ -3621,8 +4038,10 @@ irmp_ISR (void)
                 // 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
+#endif // ANALYZE\r
                     key_repetition_len = 0;\r
                 }\r
                 else\r
@@ -3632,8 +4051,10 @@ irmp_ISR (void)
                 // 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
+#endif // ANALYZE\r
                     key_repetition_len = 0;\r
                 }\r
                 else\r
@@ -3643,19 +4064,23 @@ irmp_ISR (void)
                 // 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
+#endif // ANALYZE\r
                     key_repetition_len = 0;\r
                 }\r
                 else\r
 #endif\r
 \r
 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1\r
-                // if SAMSUNG32 protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame\r
-                if (irmp_param.protocol == IRMP_SAMSUNG32_PROTOCOL && (repetition_frame_number & 0x01))\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
-                    ANALYZE_PRINTF ("code skipped: SAMSUNG32 auto repetition frame #%d, counter = %d, auto repetition len = %d\n",\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
+#endif // ANALYZE\r
                     key_repetition_len = 0;\r
                 }\r
                 else\r
@@ -3665,8 +4090,10 @@ irmp_ISR (void)
                 // 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
+#endif // ANALYZE\r
                     key_repetition_len = 0;\r
                 }\r
                 else\r
@@ -3676,15 +4103,19 @@ irmp_ISR (void)
                 // 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
+#endif // ANALYZE\r
                     key_repetition_len = 0;\r
                 }\r
                 else\r
 #endif\r
 \r
                 {\r
+#ifdef ANALYZE\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
 \r
 #if IRMP_SUPPORT_DENON_PROTOCOL == 1\r
@@ -3703,14 +4134,18 @@ irmp_ISR (void)
                         {\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
@@ -3722,7 +4157,9 @@ irmp_ISR (void)
 #if IRMP_SUPPORT_GRUNDIG_PROTOCOL == 1\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
+#endif // ANALYZE\r
                         irmp_ir_detected = FALSE;\r
                     }\r
                     else\r
@@ -3731,7 +4168,9 @@ irmp_ISR (void)
 #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
+#ifdef ANALYZE\r
                         ANALYZE_PRINTF ("Detected NOKIA start frame, ignoring it\n");\r
+#endif // ANALYZE\r
                         irmp_ir_detected = FALSE;\r
                     }\r
                     else\r
@@ -3742,8 +4181,10 @@ irmp_ISR (void)
                         {\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
@@ -3751,8 +4192,10 @@ irmp_ISR (void)
                             }\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
@@ -3762,14 +4205,14 @@ irmp_ISR (void)
                         if (irmp_param.protocol == IRMP_KASEIKYO_PROTOCOL)\r
                         {\r
                             uint8_t xor_value;\r
-                            // ANALYZE_PRINTF ("0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",\r
-                            //                 xor_check[0], xor_check[1], xor_check[2], xor_check[3], xor_check[4], xor_check[5]);\r
 \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
+#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
+#endif // ANALYZE\r
                                 irmp_ir_detected = FALSE;\r
                             }\r
 \r
@@ -3777,7 +4220,9 @@ irmp_ISR (void)
 \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
+#endif // ANALYZE\r
                                 irmp_ir_detected = FALSE;\r
                             }\r
 \r
@@ -3790,13 +4235,17 @@ irmp_ISR (void)
                         {\r
                             if (parity == PARITY_CHECK_FAILED)\r
                             {\r
+#ifdef ANALYZE\r
                                 ANALYZE_PRINTF ("error 6: parity check failed\n");\r
+#endif // ANALYZE\r
                                 irmp_ir_detected = FALSE;\r
                             }\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
+#endif // ANALYZE\r
                                 irmp_ir_detected = FALSE;\r
                             }\r
                             irmp_tmp_address >>= 2;\r
@@ -3868,10 +4317,11 @@ irmp_ISR (void)
                 }\r
                 else\r
                 {\r
+#ifdef ANALYZE\r
                     ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');\r
+#endif // ANALYZE\r
                 }\r
 \r
-//              irmp_busy_flag          = FALSE;\r
                 irmp_start_bit_detected = 0;                                        // and wait for next start bit\r
                 irmp_tmp_command        = 0;\r
                 irmp_pulse_time         = 0;\r