Moved sleep regulating update rate of rtx task from rtx thread to OpMode implementations, as each operating mode may require a custom update rate

replace/b17b5e567cbd9f4cde8fbe815d2c54efab83ec79
Silvano Seva 2021-08-29 16:57:54 +02:00
rodzic bad5a50d7d
commit e954f3fda2
4 zmienionych plików z 7 dodań i 1 usunięć

Wyświetl plik

@ -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);
}
/**

Wyświetl plik

@ -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);
}

Wyświetl plik

@ -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)
{

Wyświetl plik

@ -262,7 +262,6 @@ void *rtx_task(void *arg)
while(1)
{
rtx_taskFunc();
sleepFor(0u, 30u);
}
}