mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
Merge pull request #5023 from mikeller/avoid_process_rx_when_no_new_rc_data
Avoid RC processing when no new RC data was received.
This commit is contained in:
commit
b47cabffef
3 changed files with 9 additions and 4 deletions
|
@ -392,13 +392,13 @@ static bool canUpdateVTX(void)
|
||||||
/*
|
/*
|
||||||
* processRx called from taskUpdateRxMain
|
* processRx called from taskUpdateRxMain
|
||||||
*/
|
*/
|
||||||
void processRx(timeUs_t currentTimeUs)
|
bool processRx(timeUs_t currentTimeUs)
|
||||||
{
|
{
|
||||||
static bool armedBeeperOn = false;
|
static bool armedBeeperOn = false;
|
||||||
static bool airmodeIsActivated;
|
static bool airmodeIsActivated;
|
||||||
|
|
||||||
if (!calculateRxChannelsAndUpdateFailsafe(currentTimeUs)) {
|
if (!calculateRxChannelsAndUpdateFailsafe(currentTimeUs)) {
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// in 3D mode, we need to be able to disarm by switch at any time
|
// 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();
|
handleVTXControlButton();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void subTaskPidController(timeUs_t currentTimeUs)
|
static void subTaskPidController(timeUs_t currentTimeUs)
|
||||||
|
|
|
@ -42,7 +42,7 @@ void resetArmingDisabled(void);
|
||||||
void disarm(void);
|
void disarm(void);
|
||||||
void tryArm(void);
|
void tryArm(void);
|
||||||
|
|
||||||
void processRx(timeUs_t currentTimeUs);
|
bool processRx(timeUs_t currentTimeUs);
|
||||||
void updateArmingStatus(void);
|
void updateArmingStatus(void);
|
||||||
void updateRcCommands(void);
|
void updateRcCommands(void);
|
||||||
|
|
||||||
|
|
|
@ -132,7 +132,10 @@ static void taskUpdateAccelerometer(timeUs_t currentTimeUs)
|
||||||
|
|
||||||
static void taskUpdateRxMain(timeUs_t currentTimeUs)
|
static void taskUpdateRxMain(timeUs_t currentTimeUs)
|
||||||
{
|
{
|
||||||
processRx(currentTimeUs);
|
if (!processRx(currentTimeUs)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
isRXDataNew = true;
|
isRXDataNew = true;
|
||||||
|
|
||||||
#if !defined(USE_ALT_HOLD)
|
#if !defined(USE_ALT_HOLD)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue