From 0927847adb7fe79672218b592b94891373d3e29a Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Fri, 25 Mar 2022 12:32:56 +0100 Subject: [PATCH] Stop telemetry timer when not needed --- radio/src/pulses/pulses.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/radio/src/pulses/pulses.cpp b/radio/src/pulses/pulses.cpp index 2bfec08f0..8bdbeceb5 100755 --- a/radio/src/pulses/pulses.cpp +++ b/radio/src/pulses/pulses.cpp @@ -101,6 +101,12 @@ void startPulses() void stopPulses() { + if (telemetryTimer) { + if( xTimerStop( telemetryTimer, 5 / RTOS_MS_PER_TICK ) != pdPASS ) { + /* The timer could not be set into the Active state. */ + } + } + s_pulses_paused = true; for (uint8_t i = 0; i < NUM_MODULES; i++) moduleState[i].protocol = PROTOCOL_CHANNELS_UNINITIALIZED;