summaryrefslogtreecommitdiff
path: root/irmp
diff options
context:
space:
mode:
authorGerhard Sittig <gerhard.sittig@gmx.net>2020-02-22 06:49:03 +0100
committerGerhard Sittig <gerhard.sittig@gmx.net>2020-07-18 15:27:37 +0200
commit7f8ea39e26770753a389ce1c7bac48c036a5e2e2 (patch)
tree90864c5e4a2d345e61fd25598e2a85c63a73c7c7 /irmp
parent79ef37604df9ecc10d573fe8da41d2e6d80bbf7b (diff)
downloadlibsigrokdecode-7f8ea39e26770753a389ce1c7bac48c036a5e2e2.tar.gz
libsigrokdecode-7f8ea39e26770753a389ce1c7bac48c036a5e2e2.zip
irmp: introduce variables for start of IR frame and current sample
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.
Diffstat (limited to 'irmp')
-rw-r--r--irmp/irmp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/irmp/irmp.c b/irmp/irmp.c
index 61711e5..ccf3c25 100644
--- a/irmp/irmp.c
+++ b/irmp/irmp.c
@@ -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