1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-24 16:55:29 +03:00

Merge pull request #2964 from iNavFlight/agh_fix_rx_false_timeout

Fix incorrect timeout detection in rxIsReceivingSignal()
This commit is contained in:
Alberto García Hierro 2018-03-23 23:05:06 +00:00 committed by GitHub
commit 4a10153ca2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -85,7 +85,6 @@ static bool rxIsInFailsafeMode = true;
static timeUs_t rxNextUpdateAtUs = 0;
static uint32_t needRxSignalBefore = 0;
static uint32_t needRxSignalMaxDelayUs;
static uint32_t suspendRxSignalUntil = 0;
static uint8_t skipRxSamples = 0;
@ -402,7 +401,7 @@ bool rxUpdateCheck(timeUs_t currentTimeUs, timeDelta_t currentDeltaTime)
rxDataProcessingRequired = true;
rxSignalReceived = true;
rxIsInFailsafeMode = false;
needRxSignalBefore = currentTimeUs + needRxSignalMaxDelayUs;
needRxSignalBefore = currentTimeUs + rxRuntimeConfig.rxSignalTimeout;
resetPPMDataReceivedState();
}
} else if (feature(FEATURE_RX_PARALLEL_PWM)) {
@ -410,7 +409,7 @@ bool rxUpdateCheck(timeUs_t currentTimeUs, timeDelta_t currentDeltaTime)
rxDataProcessingRequired = true;
rxSignalReceived = true;
rxIsInFailsafeMode = false;
needRxSignalBefore = currentTimeUs + needRxSignalMaxDelayUs;
needRxSignalBefore = currentTimeUs + rxRuntimeConfig.rxSignalTimeout;
}
} else
#endif
@ -420,7 +419,7 @@ bool rxUpdateCheck(timeUs_t currentTimeUs, timeDelta_t currentDeltaTime)
rxDataProcessingRequired = true;
rxIsInFailsafeMode = (frameStatus & RX_FRAME_FAILSAFE) != 0;
rxSignalReceived = !rxIsInFailsafeMode;
needRxSignalBefore = currentTimeUs + needRxSignalMaxDelayUs;
needRxSignalBefore = currentTimeUs + rxRuntimeConfig.rxSignalTimeout;
}
if (frameStatus & RX_FRAME_PROCESSING_REQUIRED) {