From 267fa84f3f55ccee48f8a6f964b11eeaf9f27113 Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Thu, 7 Jul 2022 07:00:40 +0200 Subject: [PATCH] WiP: better restartModule() --- radio/src/pulses/pulses.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/radio/src/pulses/pulses.cpp b/radio/src/pulses/pulses.cpp index 7a057687a..489d03957 100755 --- a/radio/src/pulses/pulses.cpp +++ b/radio/src/pulses/pulses.cpp @@ -102,14 +102,12 @@ void restartModule(uint8_t idx) pauseMixerCalculations(); pausePulses(); - if (idx == INTERNAL_MODULE) INTERNAL_MODULE_OFF(); - else EXTERNAL_MODULE_OFF(); + if (idx == INTERNAL_MODULE) stopPulsesInternalModule(); +#if defined(HARDWARE_EXTERNAL_MODULE) + else stopPulsesExternalModule(); +#endif - RTOS_WAIT_MS(20); // 20ms so that the pulses interrupt will reinit the frame rate - telemetryProtocol = 255; // force telemetry port + module reinitialization - - if (idx == INTERNAL_MODULE) INTERNAL_MODULE_ON(); - else EXTERNAL_MODULE_ON(); + RTOS_WAIT_MS(200); // 20ms so that the pulses interrupt will reinit the frame rate resumePulses(); resumeMixerCalculations();