1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-25 17:25:18 +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 timeUs_t rxNextUpdateAtUs = 0;
static uint32_t needRxSignalBefore = 0; static uint32_t needRxSignalBefore = 0;
static uint32_t needRxSignalMaxDelayUs;
static uint32_t suspendRxSignalUntil = 0; static uint32_t suspendRxSignalUntil = 0;
static uint8_t skipRxSamples = 0; static uint8_t skipRxSamples = 0;
@ -402,7 +401,7 @@ bool rxUpdateCheck(timeUs_t currentTimeUs, timeDelta_t currentDeltaTime)
rxDataProcessingRequired = true; rxDataProcessingRequired = true;
rxSignalReceived = true; rxSignalReceived = true;
rxIsInFailsafeMode = false; rxIsInFailsafeMode = false;
needRxSignalBefore = currentTimeUs + needRxSignalMaxDelayUs; needRxSignalBefore = currentTimeUs + rxRuntimeConfig.rxSignalTimeout;
resetPPMDataReceivedState(); resetPPMDataReceivedState();
} }
} else if (feature(FEATURE_RX_PARALLEL_PWM)) { } else if (feature(FEATURE_RX_PARALLEL_PWM)) {
@ -410,7 +409,7 @@ bool rxUpdateCheck(timeUs_t currentTimeUs, timeDelta_t currentDeltaTime)
rxDataProcessingRequired = true; rxDataProcessingRequired = true;
rxSignalReceived = true; rxSignalReceived = true;
rxIsInFailsafeMode = false; rxIsInFailsafeMode = false;
needRxSignalBefore = currentTimeUs + needRxSignalMaxDelayUs; needRxSignalBefore = currentTimeUs + rxRuntimeConfig.rxSignalTimeout;
} }
} else } else
#endif #endif
@ -420,7 +419,7 @@ bool rxUpdateCheck(timeUs_t currentTimeUs, timeDelta_t currentDeltaTime)
rxDataProcessingRequired = true; rxDataProcessingRequired = true;
rxIsInFailsafeMode = (frameStatus & RX_FRAME_FAILSAFE) != 0; rxIsInFailsafeMode = (frameStatus & RX_FRAME_FAILSAFE) != 0;
rxSignalReceived = !rxIsInFailsafeMode; rxSignalReceived = !rxIsInFailsafeMode;
needRxSignalBefore = currentTimeUs + needRxSignalMaxDelayUs; needRxSignalBefore = currentTimeUs + rxRuntimeConfig.rxSignalTimeout;
} }
if (frameStatus & RX_FRAME_PROCESSING_REQUIRED) { if (frameStatus & RX_FRAME_PROCESSING_REQUIRED) {