kopia lustrzana https://github.com/OpenRTX/OpenRTX
Moved sleep regulating update rate of rtx task from rtx thread to OpMode implementations, as each operating mode may require a custom update rate
rodzic
bad5a50d7d
commit
e954f3fda2
|
@ -21,6 +21,7 @@
|
|||
#ifndef OPMODE_H
|
||||
#define OPMODE_H
|
||||
|
||||
#include <interfaces/delays.h>
|
||||
#include "rtx.h"
|
||||
|
||||
/**
|
||||
|
@ -75,6 +76,7 @@ public:
|
|||
{
|
||||
(void) status;
|
||||
(void) newCfg;
|
||||
sleepFor(0u, 30u);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
***************************************************************************/
|
||||
|
||||
#include <interfaces/platform.h>
|
||||
#include <interfaces/delays.h>
|
||||
#include <interfaces/audio.h>
|
||||
#include <interfaces/radio.h>
|
||||
#include <OpMode_M17.h>
|
||||
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -262,7 +262,6 @@ void *rtx_task(void *arg)
|
|||
while(1)
|
||||
{
|
||||
rtx_taskFunc();
|
||||
sleepFor(0u, 30u);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue