Moved sleep regulating update rate of rtx task from rtx thread to OpMode implementations, as each operating mode may require a custom update rate
This commit is contained in:
parent
bad5a50d7d
commit
e954f3fda2
|
|
@ -21,6 +21,7 @@
|
||||||
#ifndef OPMODE_H
|
#ifndef OPMODE_H
|
||||||
#define OPMODE_H
|
#define OPMODE_H
|
||||||
|
|
||||||
|
#include <interfaces/delays.h>
|
||||||
#include "rtx.h"
|
#include "rtx.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -75,6 +76,7 @@ public:
|
||||||
{
|
{
|
||||||
(void) status;
|
(void) status;
|
||||||
(void) newCfg;
|
(void) newCfg;
|
||||||
|
sleepFor(0u, 30u);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -192,4 +192,7 @@ void OpMode_FM::update(rtxStatus_t *const status, const bool newCfg)
|
||||||
platform_ledOff(RED);
|
platform_ledOff(RED);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Sleep thread for 30ms for 33Hz update rate
|
||||||
|
sleepFor(0u, 30u);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <interfaces/platform.h>
|
#include <interfaces/platform.h>
|
||||||
|
#include <interfaces/delays.h>
|
||||||
#include <interfaces/audio.h>
|
#include <interfaces/audio.h>
|
||||||
#include <interfaces/radio.h>
|
#include <interfaces/radio.h>
|
||||||
#include <OpMode_M17.h>
|
#include <OpMode_M17.h>
|
||||||
|
|
@ -53,6 +54,7 @@ void OpMode_M17::update(rtxStatus_t *const status, const bool newCfg)
|
||||||
if(status->opStatus == RX)
|
if(status->opStatus == RX)
|
||||||
{
|
{
|
||||||
// TODO: Implement M17 Rx
|
// TODO: Implement M17 Rx
|
||||||
|
sleepFor(0u, 30u);
|
||||||
}
|
}
|
||||||
else if((status->opStatus == OFF) && enterRx)
|
else if((status->opStatus == OFF) && enterRx)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -262,7 +262,6 @@ void *rtx_task(void *arg)
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
rtx_taskFunc();
|
rtx_taskFunc();
|
||||||
sleepFor(0u, 30u);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue