]> sigrok.org Git - libsigrokdecode.git/commitdiff
irmp: introduce variables for start of IR frame and current sample
authorGerhard Sittig <redacted>
Sat, 22 Feb 2020 05:49:03 +0000 (06:49 +0100)
committerGerhard Sittig <redacted>
Sat, 18 Jul 2020 13:27:37 +0000 (15:27 +0200)
Introduce variables in the IRMP core logic which track the current
sample number, and the position where the start of an IR frame got
detected. The variables are conditional (ANALYZE builds only).

Provided by: Rene Staffen

Local modification: Drop the initializer for the static variables.
They reside in .bss and need not occupy .data space.

irmp/irmp.c

index 61711e5581e9680f16e271557a3c3816a4c6aef6..ccf3c25aba780be5c463da404231d1b06c4ca714 100644 (file)
@@ -2976,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
@@ -3067,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