]> cloudbase.mooo.com Git - irmp.git/blobdiff - irmp.c
Version 2.6.4: changed timing tolerance of KASEIKYO
[irmp.git] / irmp.c
diff --git a/irmp.c b/irmp.c
index 9565a9cbd0a2f3754e7cdddf83b6b29f41b7c713..018bb7fad36c2ad2af2738b0203102f67acdae8b 100644 (file)
--- a/irmp.c
+++ b/irmp.c
@@ -1,13 +1,11 @@
 /*---------------------------------------------------------------------------------------------------------------------------------------------------\r
  * irmp.c - infrared multi-protocol decoder, supports several remote control protocols\r
  *\r
- * Copyright (c) 2009-2013 Frank Meyer - frank(at)fli4l.de\r
+ * Copyright (c) 2009-2014 Frank Meyer - frank(at)fli4l.de\r
  *\r
- * $Id: irmp.c,v 1.151 2014/07/01 08:27:22 fm Exp $\r
+ * $Id: irmp.c,v 1.164 2014/09/15 12:36:28 fm Exp $\r
  *\r
- * ATMEGA88 @ 8 MHz\r
- *\r
- * Supported mikrocontrollers:\r
+ * Supported AVR mikrocontrollers:\r
  *\r
  * ATtiny87,  ATtiny167\r
  * ATtiny45,  ATtiny85\r
 #define MATSUSHITA_0_PAUSE_LEN_MIN              ((uint8_t)(F_INTERRUPTS * MATSUSHITA_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r
 #define MATSUSHITA_0_PAUSE_LEN_MAX              ((uint8_t)(F_INTERRUPTS * MATSUSHITA_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)\r
 \r
-#define KASEIKYO_START_BIT_PULSE_LEN_MIN        ((uint8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
-#define KASEIKYO_START_BIT_PULSE_LEN_MAX        ((uint8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
-#define KASEIKYO_START_BIT_PAUSE_LEN_MIN        ((uint8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
-#define KASEIKYO_START_BIT_PAUSE_LEN_MAX        ((uint8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#define KASEIKYO_START_BIT_PULSE_LEN_MIN        ((uint8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r
+#define KASEIKYO_START_BIT_PULSE_LEN_MAX        ((uint8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r
+#define KASEIKYO_START_BIT_PAUSE_LEN_MIN        ((uint8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r
+#define KASEIKYO_START_BIT_PAUSE_LEN_MAX        ((uint8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r
 #define KASEIKYO_PULSE_LEN_MIN                  ((uint8_t)(F_INTERRUPTS * KASEIKYO_PULSE_TIME * MIN_TOLERANCE_50 + 0.5) - 1)\r
 #define KASEIKYO_PULSE_LEN_MAX                  ((uint8_t)(F_INTERRUPTS * KASEIKYO_PULSE_TIME * MAX_TOLERANCE_50 + 0.5) + 1)\r
 #define KASEIKYO_1_PAUSE_LEN_MIN                ((uint8_t)(F_INTERRUPTS * KASEIKYO_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r
@@ -479,12 +477,8 @@ static int                                      verbose;
 #else\r
 #  define ANALYZE_PUTCHAR(a)\r
 #  define ANALYZE_ONLY_NORMAL_PUTCHAR(a)\r
-#  if defined(__XC8)\r
-#    define ANALYZE_PRINTF(__VA_ARGS)\r
-#    define ANALYZE_ONLY_NORMAL_PRINTF(__VA_ARGS)\r
-#  else\r
-#    define ANALYZE_PRINTF(...)\r
-#    define ANALYZE_ONLY_NORMAL_PRINTF(...)\r
+#  define ANALYZE_PRINTF(...)\r
+#  define ANALYZE_ONLY_NORMAL_PRINTF(...)\r
 #  endif\r
 #  define ANALYZE_NEWLINE()\r
 *********************************/\r
@@ -502,51 +496,98 @@ static void                                     (*irmp_callback_ptr) (uint8_t);
  *---------------------------------------------------------------------------------------------------------------------------------------------------\r
  */\r
 #if defined(UNIX_OR_WINDOWS) || IRMP_PROTOCOL_NAMES == 1\r
-char *\r
-irmp_protocol_names[IRMP_N_PROTOCOLS + 1] =\r
+static const char proto_unknown[]       PROGMEM = "UNKNOWN";\r
+static const char proto_sircs[]         PROGMEM = "SIRCS";\r
+static const char proto_nec[]           PROGMEM = "NEC";\r
+static const char proto_samsung[]       PROGMEM = "SAMSUNG";\r
+static const char proto_matsushita[]    PROGMEM = "MATSUSH";\r
+static const char proto_kaseikyo[]      PROGMEM = "KASEIKYO";\r
+static const char proto_recs80[]        PROGMEM = "RECS80";\r
+static const char proto_rc5[]           PROGMEM = "RC5";\r
+static const char proto_denon[]         PROGMEM = "DENON";\r
+static const char proto_rc6[]           PROGMEM = "RC6";\r
+static const char proto_samsung32[]     PROGMEM = "SAMSG32";\r
+static const char proto_apple[]         PROGMEM = "APPLE";\r
+static const char proto_recs80ext[]     PROGMEM = "RECS80EX";\r
+static const char proto_nubert[]        PROGMEM = "NUBERT";\r
+static const char proto_bang_olufsen[]  PROGMEM = "BANG OLU";\r
+static const char proto_grundig[]       PROGMEM = "GRUNDIG";\r
+static const char proto_nokia[]         PROGMEM = "NOKIA";\r
+static const char proto_siemens[]       PROGMEM = "SIEMENS";\r
+static const char proto_fdc[]           PROGMEM = "FDC";\r
+static const char proto_rccar[]         PROGMEM = "RCCAR";\r
+static const char proto_jvc[]           PROGMEM = "JVC";\r
+static const char proto_rc6a[]          PROGMEM = "RC6A";\r
+static const char proto_nikon[]         PROGMEM = "NIKON";\r
+static const char proto_ruwido[]        PROGMEM = "RUWIDO";\r
+static const char proto_ir60[]          PROGMEM = "IR60";\r
+static const char proto_kathrein[]      PROGMEM = "KATHREIN";\r
+static const char proto_netbox[]        PROGMEM = "NETBOX";\r
+static const char proto_nec16[]         PROGMEM = "NEC16";\r
+static const char proto_nec42[]         PROGMEM = "NEC42";\r
+static const char proto_lego[]          PROGMEM = "LEGO";\r
+static const char proto_thomson[]       PROGMEM = "THOMSON";\r
+static const char proto_bose[]          PROGMEM = "BOSE";\r
+static const char proto_a1tvbox[]       PROGMEM = "A1TVBOX";\r
+static const char proto_ortek[]         PROGMEM = "ORTEK";\r
+static const char proto_telefunken[]    PROGMEM = "TELEFUNKEN";\r
+static const char proto_roomba[]        PROGMEM = "ROOMBA";\r
+static const char proto_rcmm32[]        PROGMEM = "RCMM32";\r
+static const char proto_rcmm24[]        PROGMEM = "RCMM24";\r
+static const char proto_rcmm12[]        PROGMEM = "RCMM12";\r
+static const char proto_speaker[]       PROGMEM = "SPEAKER";\r
+static const char proto_lgair[]         PROGMEM = "LGAIR";\r
+static const char proto_samsung48[]     PROGMEM = "SAMSG48";\r
+\r
+static const char proto_radio1[]        PROGMEM = "RADIO1";\r
+\r
+const char * const\r
+irmp_protocol_names[IRMP_N_PROTOCOLS + 1] PROGMEM =\r
 {\r
-    "UNKNOWN",\r
-    "SIRCS",\r
-    "NEC",\r
-    "SAMSUNG",\r
-    "MATSUSH",\r
-    "KASEIKYO",\r
-    "RECS80",\r
-    "RC5",\r
-    "DENON",\r
-    "RC6",\r
-    "SAMSG32",\r
-    "APPLE",\r
-    "RECS80EX",\r
-    "NUBERT",\r
-    "BANG OLU",\r
-    "GRUNDIG",\r
-    "NOKIA",\r
-    "SIEMENS",\r
-    "FDC",\r
-    "RCCAR",\r
-    "JVC",\r
-    "RC6A",\r
-    "NIKON",\r
-    "RUWIDO",\r
-    "IR60",\r
-    "KATHREIN",\r
-    "NETBOX",\r
-    "NEC16",\r
-    "NEC42",\r
-    "LEGO",\r
-    "THOMSON",\r
-    "BOSE",\r
-    "A1TVBOX",\r
-    "ORTEK",\r
-    "TELEFUNKEN",\r
-    "ROOMBA",\r
-    "RCMM32",\r
-    "RCMM24",\r
-    "RCMM12",\r
-    "SPEAKER",\r
-    "LGAIR",\r
-    "RADIO1"\r
+    proto_unknown,\r
+    proto_sircs,\r
+    proto_nec,\r
+    proto_samsung,\r
+    proto_matsushita,\r
+    proto_kaseikyo,\r
+    proto_recs80,\r
+    proto_rc5,\r
+    proto_denon,\r
+    proto_rc6,\r
+    proto_samsung32,\r
+    proto_apple,\r
+    proto_recs80ext,\r
+    proto_nubert,\r
+    proto_bang_olufsen,\r
+    proto_grundig,\r
+    proto_nokia,\r
+    proto_siemens,\r
+    proto_fdc,\r
+    proto_rccar,\r
+    proto_jvc,\r
+    proto_rc6a,\r
+    proto_nikon,\r
+    proto_ruwido,\r
+    proto_ir60,\r
+    proto_kathrein,\r
+    proto_netbox,\r
+    proto_nec16,\r
+    proto_nec42,\r
+    proto_lego,\r
+    proto_thomson,\r
+    proto_bose,\r
+    proto_a1tvbox,\r
+    proto_ortek,\r
+    proto_telefunken,\r
+    proto_roomba,\r
+    proto_rcmm32,\r
+    proto_rcmm24,\r
+    proto_rcmm12,\r
+    proto_speaker,\r
+    proto_lgair,\r
+    proto_samsung48,\r
+\r
+    proto_radio1\r
 };\r
 \r
 #endif\r
@@ -557,13 +598,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
@@ -605,6 +657,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
@@ -615,6 +668,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
@@ -628,8 +720,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
@@ -643,16 +736,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
@@ -667,79 +781,6 @@ irmp_uart_putc (unsigned char ch)
 #define ENDBITS                        1000                                 // number of sequenced highbits to detect end\r
 #define DATALEN                         700                                 // log buffer size\r
 \r
-#if 0                                                                       // old log routine\r
-\r
-static void\r
-irmp_log (uint8_t val)\r
-{\r
-    static uint8_t  buf[DATALEN];                                           // logging buffer\r
-    static uint16_t buf_idx;                                                // number of written bits\r
-    static uint8_t  startcycles;                                            // current number of start-zeros\r
-    static uint16_t cnt;                                                    // counts sequenced highbits - to detect end\r
-\r
-    if (! val && (startcycles < STARTCYCLES) && !buf_idx)                   // prevent that single random zeros init logging\r
-    {\r
-        startcycles++;\r
-    }\r
-    else\r
-    {\r
-        startcycles = 0;\r
-\r
-        if (! val || (val && buf_idx != 0))                                 // start or continue logging on "0", "1" cannot init logging\r
-        {\r
-            if (buf_idx < DATALEN * 8)                                      // index in range?\r
-            {                                                               // yes\r
-                if (val)\r
-                {\r
-                    buf[(buf_idx / 8)] |=  (1<<(buf_idx % 8));              // set bit\r
-                }\r
-                else\r
-                {\r
-                    buf[(buf_idx / 8)] &= ~(1<<(buf_idx % 8));              // reset bit\r
-                }\r
-\r
-                buf_idx++;\r
-            }\r
-\r
-            if (val)\r
-            {                                                               // if high received then look at log-stop condition\r
-                cnt++;\r
-\r
-                if (cnt > ENDBITS)\r
-                {                                                           // if stop condition is true, output on uart\r
-                    uint16_t i;\r
-\r
-                    for (i = 0; i < STARTCYCLES; i++)\r
-                    {\r
-                        irmp_uart_putc ('0');                               // the ignored starting zeros\r
-                    }\r
-\r
-                    for (i = 0; i < (buf_idx - ENDBITS + 20) / 8; i++)      // transform bitset into uart chars\r
-                    {\r
-                        uint8_t d = buf[i];\r
-                        uint8_t j;\r
-\r
-                        for (j = 0; j < 8; j++)\r
-                        {\r
-                            irmp_uart_putc ((d & 1) + '0');\r
-                            d >>= 1;\r
-                        }\r
-                    }\r
-\r
-                    irmp_uart_putc ('\n');\r
-                    buf_idx = 0;\r
-                }\r
-            }\r
-            else\r
-            {\r
-                cnt = 0;\r
-            }\r
-        }\r
-    }\r
-}\r
-\r
-#else                                                                       // new log routine\r
-\r
 static void\r
 irmp_log (uint8_t val)\r
 {\r
@@ -828,8 +869,6 @@ irmp_log (uint8_t val)
     }\r
 }\r
 \r
-#endif\r
-\r
 #else\r
 #define irmp_log(val)\r
 #endif //IRMP_LOGGING\r
@@ -1666,7 +1705,7 @@ static IRMP_PARAMETER                       irmp_param;
 static IRMP_PARAMETER                       irmp_param2;\r
 #endif\r
 \r
-static volatile uint8_t                     irmp_ir_detected;\r
+static volatile uint8_t                     irmp_ir_detected = FALSE;\r
 static volatile uint8_t                     irmp_protocol;\r
 static volatile uint16_t                    irmp_address;\r
 static volatile uint16_t                    irmp_command;\r
@@ -1758,7 +1797,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
@@ -1770,7 +1817,7 @@ irmp_get_data (IRMP_DATA * irmp_data_p)
                 {\r
 #ifdef ANALYZE\r
                     ANALYZE_PRINTF ("Switching to APPLE protocol\n");\r
-#endif\r
+#endif // ANALYZE\r
                     irmp_protocol = IRMP_APPLE_PROTOCOL;\r
                     irmp_address = (irmp_command & 0xFF00) >> 8;\r
                     irmp_command &= 0x00FF;\r
@@ -1821,7 +1868,7 @@ irmp_get_data (IRMP_DATA * irmp_data_p)
                 {\r
 #ifdef ANALYZE\r
                     ANALYZE_PRINTF("Info IR60: got start instruction frame\n");\r
-#endif\r
+#endif // ANALYZE\r
                 }\r
                 break;\r
 #endif\r
@@ -1858,14 +1905,14 @@ irmp_get_data (IRMP_DATA * irmp_data_p)
                     {\r
 #ifdef ANALYZE\r
                         ANALYZE_PRINTF("error NETBOX: bit6/7 must be 0/1\n");\r
-#endif\r
+#endif // ANALYZE\r
                     }\r
                 }\r
                 else\r
                 {\r
 #ifdef ANALYZE\r
                     ANALYZE_PRINTF("error NETBOX: last bit not set\n");\r
-#endif\r
+#endif // ANALYZE\r
                 }\r
                 break;\r
 #endif\r
@@ -1883,7 +1930,7 @@ irmp_get_data (IRMP_DATA * irmp_data_p)
                 {\r
 #ifdef ANALYZE\r
                     ANALYZE_PRINTF ("CRC error in LEGO protocol\n");\r
-#endif\r
+#endif // ANALYZE\r
                     // rtc = TRUE;                              // don't accept codes with CRC errors\r
                 }\r
                 break;\r
@@ -1932,7 +1979,7 @@ 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
@@ -2028,7 +2075,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
@@ -2169,7 +2225,7 @@ irmp_ISR (void)
 \r
 #ifdef ANALYZE\r
     time_counter++;\r
-#endif\r
+#endif // ANALYZE\r
 \r
     irmp_input = input(IRMP_PIN);\r
 \r
@@ -2198,11 +2254,9 @@ irmp_ISR (void)
 #ifdef ANALYZE\r
                 if (! irmp_pulse_time)\r
                 {\r
-#ifdef ANALYZE\r
                     ANALYZE_PRINTF("%8.3fms [starting pulse]\n", (double) (time_counter * 1000) / F_INTERRUPTS);\r
-#endif\r
                 }\r
-#endif\r
+#endif // ANALYZE\r
                 irmp_pulse_time++;                                              // increment counter\r
             }\r
             else\r
@@ -2217,6 +2271,9 @@ 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
@@ -2247,8 +2304,8 @@ irmp_ISR (void)
                             {\r
 #ifdef ANALYZE\r
                                 ANALYZE_PRINTF ("%8.3fms warning: did not receive inverted command repetition\n",\r
-#endif\r
                                                 (double) (time_counter * 1000) / F_INTERRUPTS);\r
+#endif // ANALYZE\r
                                 last_irmp_denon_command = 0;\r
                                 denon_repetition_len = 0xFFFF;\r
                             }\r
@@ -2284,9 +2341,9 @@ irmp_ISR (void)
 #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\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
@@ -2294,7 +2351,8 @@ irmp_ISR (void)
                 }\r
                 else\r
                 {                                                               // receiving first data pulse!\r
-                    IRMP_PARAMETER * irmp_param_p = (IRMP_PARAMETER *) 0;\r
+                    IRMP_PARAMETER * irmp_param_p;\r
+                    irmp_param_p = (IRMP_PARAMETER *) 0;\r
 \r
 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)\r
                     irmp_param2.protocol = 0;\r
@@ -2302,7 +2360,7 @@ irmp_ISR (void)
 \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\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
@@ -2312,7 +2370,7 @@ irmp_ISR (void)
                         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\r
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) (IRMP_PARAMETER *) &sircs_param;\r
                     }\r
                     else\r
@@ -2327,7 +2385,7 @@ irmp_ISR (void)
                         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\r
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &nec_param;\r
                     }\r
                     else\r
@@ -2342,14 +2400,14 @@ irmp_ISR (void)
                         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\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\r
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &nec_param;\r
 #endif\r
                     }\r
@@ -2363,7 +2421,7 @@ irmp_ISR (void)
                             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\r
+#endif // ANALYZE\r
                             irmp_param_p = (IRMP_PARAMETER *) &nec_param;\r
                         }\r
                         else\r
@@ -2373,7 +2431,7 @@ irmp_ISR (void)
                             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\r
+#endif // ANALYZE\r
 \r
                             irmp_param_p = (IRMP_PARAMETER *) &nec_rep_param;\r
                         }\r
@@ -2389,7 +2447,7 @@ irmp_ISR (void)
                         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\r
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &nec_param;\r
                     }\r
                     else\r
@@ -2405,7 +2463,7 @@ irmp_ISR (void)
                         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\r
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &telefunken_param;\r
                     }\r
                     else\r
@@ -2419,7 +2477,7 @@ irmp_ISR (void)
                         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\r
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &roomba_param;\r
                     }\r
                     else\r
@@ -2433,7 +2491,7 @@ irmp_ISR (void)
                         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\r
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &nikon_param;\r
                     }\r
                     else\r
@@ -2447,7 +2505,7 @@ irmp_ISR (void)
                         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\r
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &samsung_param;\r
                     }\r
                     else\r
@@ -2461,7 +2519,7 @@ irmp_ISR (void)
                         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\r
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &matsushita_param;\r
                     }\r
                     else\r
@@ -2475,7 +2533,7 @@ irmp_ISR (void)
                         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\r
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &kaseikyo_param;\r
                     }\r
                     else\r
@@ -2489,7 +2547,7 @@ irmp_ISR (void)
                         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\r
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &radio1_param;\r
                     }\r
                     else\r
@@ -2503,7 +2561,7 @@ irmp_ISR (void)
                         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\r
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &recs80_param;\r
                     }\r
                     else\r
@@ -2527,7 +2585,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\r
+#endif // ANALYZE\r
                             memcpy_P (&irmp_param2, &fdc_param, sizeof (IRMP_PARAMETER));\r
                         }\r
                         else\r
@@ -2545,7 +2603,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\r
+#endif // ANALYZE\r
                             memcpy_P (&irmp_param2, &rccar_param, sizeof (IRMP_PARAMETER));\r
                         }\r
                         else\r
@@ -2557,7 +2615,7 @@ irmp_ISR (void)
                                             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\r
+#endif // ANALYZE\r
                         }\r
 \r
                         irmp_param_p = (IRMP_PARAMETER *) &rc5_param;\r
@@ -2587,7 +2645,7 @@ irmp_ISR (void)
                                         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\r
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &denon_param;\r
                     }\r
                     else\r
@@ -2603,7 +2661,7 @@ irmp_ISR (void)
                                         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\r
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &thomson_param;\r
                     }\r
                     else\r
@@ -2617,7 +2675,7 @@ irmp_ISR (void)
                         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\r
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &bose_param;\r
                     }\r
                     else\r
@@ -2631,7 +2689,7 @@ irmp_ISR (void)
                         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\r
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &rc6_param;\r
                         last_pause = 0;\r
                         last_value = 1;\r
@@ -2647,7 +2705,7 @@ irmp_ISR (void)
                         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\r
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &recs80ext_param;\r
                     }\r
                     else\r
@@ -2661,7 +2719,7 @@ irmp_ISR (void)
                         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\r
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &nubert_param;\r
                     }\r
                     else\r
@@ -2675,7 +2733,7 @@ irmp_ISR (void)
                         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\r
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &speaker_param;\r
                     }\r
                     else\r
@@ -2699,7 +2757,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\r
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &bang_olufsen_param;\r
                         last_value = 0;\r
                     }\r
@@ -2714,7 +2772,7 @@ irmp_ISR (void)
                         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\r
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &grundig_param;\r
                         last_pause = irmp_pause_time;\r
                         last_value  = 1;\r
@@ -2734,7 +2792,7 @@ irmp_ISR (void)
                                         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\r
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &ruwido_param;\r
                         last_pause = irmp_pause_time;\r
                         last_value  = 1;\r
@@ -2750,7 +2808,7 @@ irmp_ISR (void)
                         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\r
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &fdc_param;\r
                     }\r
                     else\r
@@ -2764,7 +2822,7 @@ irmp_ISR (void)
                         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\r
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &rccar_param;\r
                     }\r
                     else\r
@@ -2778,7 +2836,7 @@ irmp_ISR (void)
                         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\r
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &kathrein_param;\r
                     }\r
                     else\r
@@ -2792,7 +2850,7 @@ irmp_ISR (void)
                         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\r
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &netbox_param;\r
                     }\r
                     else\r
@@ -2806,7 +2864,7 @@ irmp_ISR (void)
                         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\r
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &lego_param;\r
                     }\r
                     else\r
@@ -2820,7 +2878,7 @@ irmp_ISR (void)
                         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\r
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &a1tvbox_param;\r
                         last_pause = 0;\r
                         last_value = 1;\r
@@ -2836,7 +2894,7 @@ irmp_ISR (void)
                         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\r
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &ortek_param;\r
                         last_pause  = 0;\r
                         last_value  = 1;\r
@@ -2853,7 +2911,7 @@ irmp_ISR (void)
                         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\r
+#endif // ANALYZE\r
                         irmp_param_p = (IRMP_PARAMETER *) &rcmm_param;\r
                     }\r
                     else\r
@@ -2861,8 +2919,7 @@ irmp_ISR (void)
                     {\r
 #ifdef ANALYZE\r
                         ANALYZE_PRINTF ("protocol = UNKNOWN\n");\r
-#endif\r
-//                      irmp_busy_flag = FALSE;\r
+#endif // ANALYZE\r
                         irmp_start_bit_detected = 0;                            // wait for another start bit...\r
                     }\r
 \r
@@ -2875,7 +2932,7 @@ irmp_ISR (void)
 #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\r
+#endif // ANALYZE\r
                         }\r
                         else\r
                         {\r
@@ -2884,7 +2941,7 @@ irmp_ISR (void)
                                             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\r
+#endif // ANALYZE\r
                         }\r
 \r
 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)\r
@@ -2895,7 +2952,7 @@ irmp_ISR (void)
                             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\r
+#endif // ANALYZE\r
                         }\r
 #endif\r
 \r
@@ -2905,7 +2962,7 @@ irmp_ISR (void)
                         {\r
 #ifdef ANALYZE\r
                             ANALYZE_PRINTF ("pulse_toggle: %3d - %3d\n", RC6_TOGGLE_BIT_LEN_MIN, RC6_TOGGLE_BIT_LEN_MAX);\r
-#endif\r
+#endif // ANALYZE\r
                         }\r
 #endif\r
 \r
@@ -2914,7 +2971,7 @@ irmp_ISR (void)
 #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\r
+#endif // ANALYZE\r
                         }\r
                         else\r
                         {\r
@@ -2923,20 +2980,18 @@ irmp_ISR (void)
                                             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\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
-#ifdef ANALYZE\r
                             ANALYZE_PRINTF ("pulse_r: %3d - %3d\n", irmp_param.pulse_0_len_min, irmp_param.pulse_0_len_max);\r
                             ANALYZE_PRINTF ("pause_r: %3d - %3d\n", BANG_OLUFSEN_R_PAUSE_LEN_MIN, BANG_OLUFSEN_R_PAUSE_LEN_MAX);\r
-#endif\r
                         }\r
 #endif\r
 \r
-#ifdef ANALYZE\r
                         ANALYZE_PRINTF ("command_offset: %2d\n", irmp_param.command_offset);\r
                         ANALYZE_PRINTF ("command_len:    %3d\n", irmp_param.command_end - irmp_param.command_offset);\r
                         ANALYZE_PRINTF ("complete_len:   %3d\n", irmp_param.complete_len);\r
@@ -2957,7 +3012,7 @@ irmp_ISR (void)
                             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\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
@@ -2966,7 +3021,7 @@ irmp_ISR (void)
                             ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_bit, irmp_pulse_time, irmp_pause_time);\r
                             ANALYZE_PUTCHAR ((irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? '1' : '0');\r
                             ANALYZE_NEWLINE ();\r
-#endif\r
+#endif // ANALYZE\r
                             irmp_store_bit ((irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? 1 : 0);\r
                         }\r
                     }\r
@@ -2987,14 +3042,14 @@ irmp_ISR (void)
                     {\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\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
 #ifdef ANALYZE\r
                             ANALYZE_PUTCHAR ('1');                                  // yes, store 1\r
                             ANALYZE_NEWLINE ();\r
-#endif\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
@@ -3002,7 +3057,7 @@ irmp_ISR (void)
 #ifdef ANALYZE\r
                             ANALYZE_PUTCHAR ('0');                                  // yes, store 0\r
                             ANALYZE_NEWLINE ();\r
-#endif\r
+#endif // ANALYZE\r
                             irmp_store_bit (0);\r
                         }\r
                     }\r
@@ -3013,14 +3068,14 @@ irmp_ISR (void)
                     {\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\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\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
@@ -3028,7 +3083,7 @@ irmp_ISR (void)
 #ifdef ANALYZE\r
                           ANALYZE_PUTCHAR ('0');                                  // yes, store 0\r
                           ANALYZE_NEWLINE ();\r
-#endif\r
+#endif // ANALYZE\r
                           irmp_store_bit (0);\r
                         }\r
                     }\r
@@ -3063,21 +3118,17 @@ irmp_ISR (void)
 #ifdef ANALYZE\r
                             if (! (irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER))\r
                             {\r
-#ifdef ANALYZE\r
                                 ANALYZE_PRINTF ("stop bit detected\n");\r
-#endif\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
-#endif\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
@@ -3116,7 +3167,7 @@ irmp_ISR (void)
                             {\r
 #ifdef ANALYZE\r
                                 ANALYZE_PRINTF ("Switching to IR60 protocol\n");\r
-#endif\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
@@ -3140,7 +3191,7 @@ irmp_ISR (void)
                             {\r
 #ifdef ANALYZE\r
                                 ANALYZE_PRINTF ("Switching to NOKIA protocol\n");\r
-#endif\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
@@ -3169,7 +3220,7 @@ irmp_ISR (void)
                             {\r
 #ifdef ANALYZE\r
                                 ANALYZE_PRINTF ("Switching to SIEMENS protocol\n");\r
-#endif\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
@@ -3225,7 +3276,7 @@ irmp_ISR (void)
                             {\r
 #ifdef ANALYZE\r
                                 ANALYZE_PRINTF ("Switching to JVC protocol, irmp_bit = %d\n", irmp_bit);\r
-#endif\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
@@ -3239,7 +3290,7 @@ irmp_ISR (void)
                             {\r
 #ifdef ANALYZE\r
                                 ANALYZE_PRINTF ("Switching to LGAIR protocol, irmp_bit = %d\n", irmp_bit);\r
-#endif\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
@@ -3255,7 +3306,7 @@ irmp_ISR (void)
                             {\r
 #ifdef ANALYZE\r
                                 ANALYZE_PRINTF ("Switching to NEC protocol\n");\r
-#endif\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
@@ -3272,7 +3323,7 @@ irmp_ISR (void)
                             {\r
 #ifdef ANALYZE\r
                                 ANALYZE_PRINTF ("Switching to LGAIR protocol\n");\r
-#endif\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
@@ -3285,7 +3336,7 @@ irmp_ISR (void)
                             {\r
 #ifdef ANALYZE\r
                                 ANALYZE_PRINTF ("Switching to JVC protocol, irmp_bit = %d\n", irmp_bit);\r
-#endif\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
@@ -3298,6 +3349,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
@@ -3308,14 +3373,14 @@ irmp_ISR (void)
 \r
 #ifdef ANALYZE\r
                                     ANALYZE_PRINTF ("Switching to RCMM12 protocol, irmp_bit = %d\n", irmp_bit);\r
-#endif\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\r
+#endif // ANALYZE\r
                                     irmp_param.protocol     = IRMP_RCMM24_PROTOCOL;                 // switch protocol\r
                                 }\r
                                 irmp_param.stop_bit     = TRUE;                                     // set flag\r
@@ -3327,9 +3392,7 @@ irmp_ISR (void)
 #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
-#endif\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
@@ -3346,7 +3409,7 @@ irmp_ISR (void)
                 {\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\r
+#endif // ANALYZE\r
 \r
 #if IRMP_SUPPORT_MANCHESTER == 1\r
                     if ((irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER))                                     // Manchester\r
@@ -3363,7 +3426,7 @@ irmp_ISR (void)
                             {\r
 #ifdef ANALYZE\r
                                 ANALYZE_PUTCHAR ('T');\r
-#endif\r
+#endif // ANALYZE\r
                                 if (irmp_param.complete_len == RC6_COMPLETE_DATA_LEN_LONG)                      // RC6 mode 6A\r
                                 {\r
                                     irmp_store_bit (1);\r
@@ -3376,14 +3439,14 @@ irmp_ISR (void)
                                 }\r
 #ifdef ANALYZE\r
                                 ANALYZE_NEWLINE ();\r
-#endif\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\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
@@ -3391,7 +3454,7 @@ irmp_ISR (void)
                                 {\r
 #ifdef ANALYZE\r
                                     ANALYZE_PUTCHAR ('T');\r
-#endif\r
+#endif // ANALYZE\r
                                     irmp_store_bit (1);\r
 \r
                                     if (irmp_pause_time > 2 * irmp_param.pause_1_len_max)\r
@@ -3404,14 +3467,14 @@ irmp_ISR (void)
                                     }\r
 #ifdef ANALYZE\r
                                     ANALYZE_NEWLINE ();\r
-#endif\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\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
@@ -3419,7 +3482,7 @@ irmp_ISR (void)
                                     {\r
 #ifdef ANALYZE\r
                                         ANALYZE_NEWLINE ();\r
-#endif\r
+#endif // ANALYZE\r
                                     }\r
                                     last_value = (irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? 1 : 0;\r
                                 }\r
@@ -3442,7 +3505,7 @@ irmp_ISR (void)
 \r
 #ifdef ANALYZE\r
                             ANALYZE_PUTCHAR (manchester_value + '0');\r
-#endif\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
@@ -3450,7 +3513,7 @@ irmp_ISR (void)
                             {\r
 #ifdef ANALYZE\r
                                 ANALYZE_NEWLINE ();\r
-#endif\r
+#endif // ANALYZE\r
                             }\r
 \r
 #if IRMP_SUPPORT_RC6_PROTOCOL == 1\r
@@ -3458,7 +3521,7 @@ irmp_ISR (void)
                             {\r
 #ifdef ANALYZE\r
                                 ANALYZE_PRINTF ("Switching to RC6A protocol\n");\r
-#endif\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
@@ -3480,7 +3543,7 @@ irmp_ISR (void)
                             {\r
 #ifdef ANALYZE\r
                                 ANALYZE_PUTCHAR ('?');\r
-#endif\r
+#endif // ANALYZE\r
                                 irmp_param.protocol = 0;                // switch to FDC, see below\r
                             }\r
                             else\r
@@ -3493,7 +3556,7 @@ irmp_ISR (void)
                             {\r
 #ifdef ANALYZE\r
                                 ANALYZE_PUTCHAR ('?');\r
-#endif\r
+#endif // ANALYZE\r
                                 irmp_param.protocol = 0;                // switch to RCCAR, see below\r
                             }\r
                             else\r
@@ -3504,8 +3567,7 @@ irmp_ISR (void)
                                 ANALYZE_NEWLINE ();\r
                                 ANALYZE_PRINTF ("error 3 manchester: timing not correct: data bit %d,  pulse: %d, pause: %d\n", irmp_bit, irmp_pulse_time, irmp_pause_time);\r
                                 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');\r
-#endif\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
@@ -3518,14 +3580,14 @@ irmp_ISR (void)
                             {\r
 #ifdef ANALYZE\r
                                 ANALYZE_PRINTF ("   1 (FDC)\n");\r
-#endif\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\r
+#endif // ANALYZE\r
                                 irmp_store_bit2 (0);\r
                             }\r
 \r
@@ -3533,7 +3595,7 @@ irmp_ISR (void)
                             {\r
 #ifdef ANALYZE\r
                                 ANALYZE_PRINTF ("Switching to FDC protocol\n");\r
-#endif\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
@@ -3548,14 +3610,14 @@ irmp_ISR (void)
                             {\r
 #ifdef ANALYZE\r
                                 ANALYZE_PRINTF ("   1 (RCCAR)\n");\r
-#endif\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\r
+#endif // ANALYZE\r
                                 irmp_store_bit2 (0);\r
                             }\r
 \r
@@ -3563,7 +3625,7 @@ irmp_ISR (void)
                             {\r
 #ifdef ANALYZE\r
                                 ANALYZE_PRINTF ("Switching to RCCAR protocol\n");\r
-#endif\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
@@ -3585,7 +3647,7 @@ irmp_ISR (void)
                         {\r
 #ifdef ANALYZE\r
                             ANALYZE_PUTCHAR ('1');\r
-#endif\r
+#endif // ANALYZE\r
                             irmp_store_bit (1);\r
 \r
                             if (irmp_pulse_time >= irmp_param.pulse_1_len_min)\r
@@ -3602,7 +3664,7 @@ irmp_ISR (void)
                         {\r
 #ifdef ANALYZE\r
                             ANALYZE_PUTCHAR ('0');\r
-#endif\r
+#endif // ANALYZE\r
                             irmp_store_bit (0);\r
 \r
                             if (irmp_pause_time >= irmp_param.pause_1_len_min)\r
@@ -3616,7 +3678,7 @@ irmp_ISR (void)
                         }\r
 #ifdef ANALYZE\r
                         ANALYZE_NEWLINE ();\r
-#endif\r
+#endif // ANALYZE\r
                         wait_for_space = 0;\r
                     }\r
                     else\r
@@ -3630,24 +3692,35 @@ irmp_ISR (void)
                         {\r
 #ifdef ANALYZE\r
                             ANALYZE_PRINTF ("SYNC\n");\r
-#endif\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\r
+#endif // ANALYZE\r
                                 irmp_store_bit (1);\r
                                 wait_for_space = 0;\r
                             }\r
@@ -3656,22 +3729,17 @@ irmp_ISR (void)
 #ifdef ANALYZE\r
                                 ANALYZE_PUTCHAR ('0');\r
                                 ANALYZE_NEWLINE ();\r
-#endif\r
+#endif // ANALYZE\r
                                 irmp_store_bit (0);\r
                                 wait_for_space = 0;\r
                             }\r
-\r
-#ifdef ANALYZE\r
-                            ANALYZE_PRINTF ("Switching to SAMSUNG32 protocol\n");\r
-#endif\r
                         }\r
                         else\r
                         {                                                           // timing incorrect!\r
 #ifdef ANALYZE\r
                             ANALYZE_PRINTF ("error 3 Samsung: timing not correct: data bit %d,  pulse: %d, pause: %d\n", irmp_bit, irmp_pulse_time, irmp_pause_time);\r
                             ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');\r
-#endif\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
@@ -3689,7 +3757,7 @@ irmp_ISR (void)
                     {\r
 #ifdef ANALYZE\r
                         ANALYZE_PRINTF ("Switching to NEC16 protocol\n");\r
-#endif\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
@@ -3712,7 +3780,7 @@ irmp_ISR (void)
                                 {\r
 #ifdef ANALYZE\r
                                     ANALYZE_PRINTF ("3rd start bit\n");\r
-#endif\r
+#endif // ANALYZE\r
                                     wait_for_space = 0;\r
                                     irmp_bit++;\r
                                 }\r
@@ -3721,8 +3789,7 @@ irmp_ISR (void)
 #ifdef ANALYZE\r
                                     ANALYZE_PRINTF ("error 3a B&O: timing not correct: data bit %d,  pulse: %d, pause: %d\n", irmp_bit, irmp_pulse_time, irmp_pause_time);\r
                                     ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');\r
-#endif\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
@@ -3733,7 +3800,7 @@ irmp_ISR (void)
                                 {\r
 #ifdef ANALYZE\r
                                     ANALYZE_PRINTF ("trailer bit\n");\r
-#endif\r
+#endif // ANALYZE\r
                                     wait_for_space = 0;\r
                                     irmp_bit++;\r
                                 }\r
@@ -3742,8 +3809,7 @@ irmp_ISR (void)
 #ifdef ANALYZE\r
                                     ANALYZE_PRINTF ("error 3b B&O: timing not correct: data bit %d,  pulse: %d, pause: %d\n", irmp_bit, irmp_pulse_time, irmp_pause_time);\r
                                     ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');\r
-#endif\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
@@ -3755,7 +3821,7 @@ irmp_ISR (void)
 #ifdef ANALYZE\r
                                     ANALYZE_PUTCHAR ('1');\r
                                     ANALYZE_NEWLINE ();\r
-#endif\r
+#endif // ANALYZE\r
                                     irmp_store_bit (1);\r
                                     last_value = 1;\r
                                     wait_for_space = 0;\r
@@ -3765,7 +3831,7 @@ irmp_ISR (void)
 #ifdef ANALYZE\r
                                     ANALYZE_PUTCHAR ('0');\r
                                     ANALYZE_NEWLINE ();\r
-#endif\r
+#endif // ANALYZE\r
                                     irmp_store_bit (0);\r
                                     last_value = 0;\r
                                     wait_for_space = 0;\r
@@ -3775,7 +3841,7 @@ irmp_ISR (void)
 #ifdef ANALYZE\r
                                     ANALYZE_PUTCHAR (last_value + '0');\r
                                     ANALYZE_NEWLINE ();\r
-#endif\r
+#endif // ANALYZE\r
                                     irmp_store_bit (last_value);\r
                                     wait_for_space = 0;\r
                                 }\r
@@ -3784,8 +3850,7 @@ irmp_ISR (void)
 #ifdef ANALYZE\r
                                     ANALYZE_PRINTF ("error 3c B&O: timing not correct: data bit %d,  pulse: %d, pause: %d\n", irmp_bit, irmp_pulse_time, irmp_pause_time);\r
                                     ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');\r
-#endif\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
@@ -3796,8 +3861,7 @@ irmp_ISR (void)
 #ifdef ANALYZE\r
                             ANALYZE_PRINTF ("error 3d B&O: timing not correct: data bit %d,  pulse: %d, pause: %d\n", irmp_bit, irmp_pulse_time, irmp_pause_time);\r
                             ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');\r
-#endif\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
@@ -3813,7 +3877,7 @@ irmp_ISR (void)
 #ifdef ANALYZE\r
                             ANALYZE_PUTCHAR ('0');\r
                             ANALYZE_PUTCHAR ('0');\r
-#endif\r
+#endif // ANALYZE\r
                             irmp_store_bit (0);\r
                             irmp_store_bit (0);\r
                         }\r
@@ -3822,7 +3886,7 @@ irmp_ISR (void)
 #ifdef ANALYZE\r
                             ANALYZE_PUTCHAR ('0');\r
                             ANALYZE_PUTCHAR ('1');\r
-#endif\r
+#endif // ANALYZE\r
                             irmp_store_bit (0);\r
                             irmp_store_bit (1);\r
                         }\r
@@ -3831,7 +3895,7 @@ irmp_ISR (void)
 #ifdef ANALYZE\r
                             ANALYZE_PUTCHAR ('1');\r
                             ANALYZE_PUTCHAR ('0');\r
-#endif\r
+#endif // ANALYZE\r
                             irmp_store_bit (1);\r
                             irmp_store_bit (0);\r
                         }\r
@@ -3840,13 +3904,13 @@ irmp_ISR (void)
 #ifdef ANALYZE\r
                             ANALYZE_PUTCHAR ('1');\r
                             ANALYZE_PUTCHAR ('1');\r
-#endif\r
+#endif // ANALYZE\r
                             irmp_store_bit (1);\r
                             irmp_store_bit (1);\r
                         }\r
 #ifdef ANALYZE\r
                         ANALYZE_PRINTF ("\n");\r
-#endif\r
+#endif // ANALYZE\r
                         wait_for_space = 0;\r
                     }\r
                     else\r
@@ -3858,7 +3922,7 @@ irmp_ISR (void)
 #ifdef ANALYZE\r
                         ANALYZE_PUTCHAR ('1');\r
                         ANALYZE_NEWLINE ();\r
-#endif\r
+#endif // ANALYZE\r
                         irmp_store_bit (1);\r
                         wait_for_space = 0;\r
                     }\r
@@ -3868,7 +3932,7 @@ irmp_ISR (void)
 #ifdef ANALYZE\r
                         ANALYZE_PUTCHAR ('0');\r
                         ANALYZE_NEWLINE ();\r
-#endif\r
+#endif // ANALYZE\r
                         irmp_store_bit (0);\r
                         wait_for_space = 0;\r
                     }\r
@@ -3889,7 +3953,7 @@ irmp_ISR (void)
 #ifdef ANALYZE\r
                             ANALYZE_PUTCHAR ('S');\r
                             ANALYZE_NEWLINE ();\r
-#endif\r
+#endif // ANALYZE\r
                             irmp_tmp_command <<= 1;\r
                         }\r
                         else\r
@@ -3897,7 +3961,7 @@ irmp_ISR (void)
 #ifdef ANALYZE\r
                             ANALYZE_PUTCHAR ('S');\r
                             ANALYZE_NEWLINE ();\r
-#endif\r
+#endif // ANALYZE\r
                             irmp_store_bit (1);\r
                         }\r
                         wait_for_space = 0;\r
@@ -3908,8 +3972,7 @@ irmp_ISR (void)
 #ifdef ANALYZE\r
                         ANALYZE_PRINTF ("error 3: timing not correct: data bit %d,  pulse: %d, pause: %d\n", irmp_bit, irmp_pulse_time, irmp_pause_time);\r
                         ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');\r
-#endif\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
@@ -3948,7 +4011,7 @@ irmp_ISR (void)
 #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\r
+#endif // ANALYZE\r
                     key_repetition_len = 0;\r
                 }\r
                 else\r
@@ -3961,7 +4024,7 @@ irmp_ISR (void)
 #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\r
+#endif // ANALYZE\r
                     key_repetition_len = 0;\r
                 }\r
                 else\r
@@ -3974,20 +4037,20 @@ irmp_ISR (void)
 #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\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
 #ifdef ANALYZE\r
-                    ANALYZE_PRINTF ("code skipped: SAMSUNG32 auto repetition frame #%d, counter = %d, auto repetition len = %d\n",\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\r
+#endif // ANALYZE\r
                     key_repetition_len = 0;\r
                 }\r
                 else\r
@@ -4000,7 +4063,7 @@ irmp_ISR (void)
 #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\r
+#endif // ANALYZE\r
                     key_repetition_len = 0;\r
                 }\r
                 else\r
@@ -4013,7 +4076,7 @@ irmp_ISR (void)
 #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\r
+#endif // ANALYZE\r
                     key_repetition_len = 0;\r
                 }\r
                 else\r
@@ -4022,7 +4085,7 @@ irmp_ISR (void)
                 {\r
 #ifdef ANALYZE\r
                     ANALYZE_PRINTF ("%8.3fms code detected, length = %d\n", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_bit);\r
-#endif\r
+#endif // ANALYZE\r
                     irmp_ir_detected = TRUE;\r
 \r
 #if IRMP_SUPPORT_DENON_PROTOCOL == 1\r
@@ -4043,7 +4106,7 @@ irmp_ISR (void)
                             {\r
 #ifdef ANALYZE\r
                                 ANALYZE_PRINTF ("%8.3fms info Denon: waiting for inverted command repetition\n", (double) (time_counter * 1000) / F_INTERRUPTS);\r
-#endif\r
+#endif // ANALYZE\r
                                 last_irmp_denon_command = irmp_tmp_command;\r
                                 denon_repetition_len = 0;\r
                                 irmp_ir_detected = FALSE;\r
@@ -4052,7 +4115,7 @@ irmp_ISR (void)
                             {\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\r
+#endif // ANALYZE\r
                                 last_irmp_denon_command = 0;\r
                                 irmp_ir_detected = FALSE;\r
                             }\r
@@ -4066,7 +4129,7 @@ irmp_ISR (void)
                     {                                                               // Grundig start frame?\r
 #ifdef ANALYZE\r
                         ANALYZE_PRINTF ("Detected GRUNDIG start frame, ignoring it\n");\r
-#endif\r
+#endif // ANALYZE\r
                         irmp_ir_detected = FALSE;\r
                     }\r
                     else\r
@@ -4077,7 +4140,7 @@ irmp_ISR (void)
                     {                                                               // Nokia start frame?\r
 #ifdef ANALYZE\r
                         ANALYZE_PRINTF ("Detected NOKIA start frame, ignoring it\n");\r
-#endif\r
+#endif // ANALYZE\r
                         irmp_ir_detected = FALSE;\r
                     }\r
                     else\r
@@ -4091,7 +4154,7 @@ irmp_ISR (void)
 #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\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
@@ -4101,8 +4164,8 @@ irmp_ISR (void)
                             {\r
 #ifdef ANALYZE\r
                                 ANALYZE_PRINTF ("Detected NEC repetition frame, ignoring it: timeout occured, key_repetition_len = %d > %d\n",\r
-#endif\r
                                                 key_repetition_len, NEC_FRAME_REPEAT_PAUSE_LEN_MAX);\r
+#endif // ANALYZE\r
                                 irmp_ir_detected = FALSE;\r
                             }\r
                         }\r
@@ -4119,7 +4182,7 @@ irmp_ISR (void)
                             {\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\r
+#endif // ANALYZE\r
                                 irmp_ir_detected = FALSE;\r
                             }\r
 \r
@@ -4129,7 +4192,7 @@ irmp_ISR (void)
                             {\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\r
+#endif // ANALYZE\r
                                 irmp_ir_detected = FALSE;\r
                             }\r
 \r
@@ -4144,7 +4207,7 @@ irmp_ISR (void)
                             {\r
 #ifdef ANALYZE\r
                                 ANALYZE_PRINTF ("error 6: parity check failed\n");\r
-#endif\r
+#endif // ANALYZE\r
                                 irmp_ir_detected = FALSE;\r
                             }\r
 \r
@@ -4152,7 +4215,7 @@ irmp_ISR (void)
                             {\r
 #ifdef ANALYZE\r
                                 ANALYZE_PRINTF ("code skipped: ORTEK end of transmission frame (key release)\n");\r
-#endif\r
+#endif // ANALYZE\r
                                 irmp_ir_detected = FALSE;\r
                             }\r
                             irmp_tmp_address >>= 2;\r
@@ -4226,10 +4289,9 @@ irmp_ISR (void)
                 {\r
 #ifdef ANALYZE\r
                     ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');\r
-#endif\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
@@ -4653,9 +4715,7 @@ next_tick (void)
         {\r
             uint8_t key;\r
 \r
-#ifdef ANALYZE\r
             ANALYZE_ONLY_NORMAL_PUTCHAR (' ');\r
-#endif\r
 \r
             if (verbose)\r
             {\r