From 44bfdec9473eb6c49798fdf4d10ec8a2b9eaddf0 Mon Sep 17 00:00:00 2001 From: Silvano Seva Date: Sun, 22 Oct 2023 18:59:06 +0200 Subject: [PATCH] Added 30ms sleep in OpMode_M17::offState to prevent the rtx thread from going into an endless loop. --- openrtx/src/rtx/OpMode_M17.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/openrtx/src/rtx/OpMode_M17.cpp b/openrtx/src/rtx/OpMode_M17.cpp index a695beae..700896d1 100644 --- a/openrtx/src/rtx/OpMode_M17.cpp +++ b/openrtx/src/rtx/OpMode_M17.cpp @@ -162,13 +162,19 @@ void OpMode_M17::offState(rtxStatus_t *const status) if(startRx) { status->opStatus = RX; + return; } if(platform_getPttStatus() && (status->txDisable == 0)) { startTx = true; status->opStatus = TX; + return; } + + // Sleep for 30ms if there is nothing else to do in order to prevent the + // rtx thread looping endlessly and locking up all the other tasks + sleepFor(0, 30); } void OpMode_M17::rxState(rtxStatus_t *const status)