]> sigrok.org Git - libsigrokdecode.git/blobdiff - irmp/irmp.c
irmp: silence core logic ANALYZE output from the shared library
[libsigrokdecode.git] / irmp / irmp.c
index f2e7f5ade2fe530cfd5b8bf5db9aaa538a104630..ccf3c25aba780be5c463da404231d1b06c4ca714 100644 (file)
@@ -627,15 +627,13 @@ static int                                      silent;
 static int                                      time_counter;
 static int                                      verbose;
 
-/*******************************                not every PIC compiler knows variadic macros :-(
-#else
+#elif 0 /* not every PIC compiler knows variadic macros :-( */
 #  define ANALYZE_PUTCHAR(a)
 #  define ANALYZE_ONLY_NORMAL_PUTCHAR(a)
 #  define ANALYZE_PRINTF(...)
 #  define ANALYZE_ONLY_NORMAL_PRINTF(...)
-#  endif
 #  define ANALYZE_NEWLINE()
-*********************************/
+
 #endif
 
 #if IRMP_USE_CALLBACK == 1
@@ -2978,6 +2976,11 @@ irmp_store_bit2 (uint_fast8_t value)
 }
 #endif // IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
 
+#ifdef ANALYZE
+static uint32_t s_curSample;
+static uint32_t s_startBitSample;
+#endif
+
 /*---------------------------------------------------------------------------------------------------------------------------------------------------
  *  ISR routine
  *  @details  ISR routine, called 10000 times per second
@@ -3069,6 +3072,7 @@ irmp_ISR (void)
 #ifdef ANALYZE
                 if (! irmp_pulse_time)
                 {
+                    s_startBitSample = s_curSample;
                     ANALYZE_PRINTF("%8.3fms [starting pulse]\n", (double) (time_counter * 1000) / F_INTERRUPTS);
                 }
 #endif // ANALYZE
@@ -5556,6 +5560,7 @@ printf ("fm: %d %d\n", irmp_pulse_time * 1000000 / F_INTERRUPTS, RCII_BIT_LEN *
  *---------------------------------------------------------------------------------------------------------------------------------------------------
  */
 
+void print_spectrum (char * text, int * buf, int is_pulse);
 void
 print_spectrum (char * text, int * buf, int is_pulse)
 {