Avoid RC processing when no new RC data was received.
This commit is contained in:
parent
a5c9833fb6
commit
8b636ff86a
|
@ -392,13 +392,13 @@ static bool canUpdateVTX(void)
|
|||
/*
|
||||
* processRx called from taskUpdateRxMain
|
||||
*/
|
||||
void processRx(timeUs_t currentTimeUs)
|
||||
bool processRx(timeUs_t currentTimeUs)
|
||||
{
|
||||
static bool armedBeeperOn = false;
|
||||
static bool airmodeIsActivated;
|
||||
|
||||
if (!calculateRxChannelsAndUpdateFailsafe(currentTimeUs)) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
// in 3D mode, we need to be able to disarm by switch at any time
|
||||
|
@ -600,6 +600,8 @@ void processRx(timeUs_t currentTimeUs)
|
|||
handleVTXControlButton();
|
||||
}
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void subTaskPidController(timeUs_t currentTimeUs)
|
||||
|
|
|
@ -42,7 +42,7 @@ void resetArmingDisabled(void);
|
|||
void disarm(void);
|
||||
void tryArm(void);
|
||||
|
||||
void processRx(timeUs_t currentTimeUs);
|
||||
bool processRx(timeUs_t currentTimeUs);
|
||||
void updateArmingStatus(void);
|
||||
void updateRcCommands(void);
|
||||
|
||||
|
|
|
@ -132,7 +132,10 @@ static void taskUpdateAccelerometer(timeUs_t currentTimeUs)
|
|||
|
||||
static void taskUpdateRxMain(timeUs_t currentTimeUs)
|
||||
{
|
||||
processRx(currentTimeUs);
|
||||
if (!processRx(currentTimeUs)) {
|
||||
return;
|
||||
}
|
||||
|
||||
isRXDataNew = true;
|
||||
|
||||
#if !defined(USE_ALT_HOLD)
|
||||
|
|
Loading…
Reference in New Issue