diff --git a/openrtx/include/rtx/OpMode.h b/openrtx/include/rtx/OpMode.h index 75bb58df..9565b766 100644 --- a/openrtx/include/rtx/OpMode.h +++ b/openrtx/include/rtx/OpMode.h @@ -21,6 +21,7 @@ #ifndef OPMODE_H #define OPMODE_H +#include #include "rtx.h" /** @@ -75,6 +76,7 @@ public: { (void) status; (void) newCfg; + sleepFor(0u, 30u); } /** diff --git a/openrtx/src/rtx/OpMode_FM.cpp b/openrtx/src/rtx/OpMode_FM.cpp index a97512a8..31d798c0 100644 --- a/openrtx/src/rtx/OpMode_FM.cpp +++ b/openrtx/src/rtx/OpMode_FM.cpp @@ -192,4 +192,7 @@ void OpMode_FM::update(rtxStatus_t *const status, const bool newCfg) platform_ledOff(RED); break; } + + // Sleep thread for 30ms for 33Hz update rate + sleepFor(0u, 30u); } diff --git a/openrtx/src/rtx/OpMode_M17.cpp b/openrtx/src/rtx/OpMode_M17.cpp index 5ee64777..587eb764 100644 --- a/openrtx/src/rtx/OpMode_M17.cpp +++ b/openrtx/src/rtx/OpMode_M17.cpp @@ -19,6 +19,7 @@ ***************************************************************************/ #include +#include #include #include #include @@ -53,6 +54,7 @@ void OpMode_M17::update(rtxStatus_t *const status, const bool newCfg) if(status->opStatus == RX) { // TODO: Implement M17 Rx + sleepFor(0u, 30u); } else if((status->opStatus == OFF) && enterRx) { diff --git a/openrtx/src/threads.c b/openrtx/src/threads.c index f88579cb..d926228c 100644 --- a/openrtx/src/threads.c +++ b/openrtx/src/threads.c @@ -262,7 +262,6 @@ void *rtx_task(void *arg) while(1) { rtx_taskFunc(); - sleepFor(0u, 30u); } }