mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-26 01:35:41 +03:00
BUGFIX - Cleanup failsafe system so it works correctly with Serial RX
systems and Parallel PWM/PPM systems. Added setting for failsafe_max_usec. Renamed failsafe_detect_threshold to failsafe_min_usec. Failsafe now detects when a PPM/PWM RX isn't sending ANY data out on CH1-4. See documentation notes regarding Graupner receivers in Failsafe.md. Documented failsafe system.
This commit is contained in:
parent
d97722be8e
commit
032202ef8f
9 changed files with 174 additions and 46 deletions
17
src/mw.c
17
src/mw.c
|
@ -234,28 +234,17 @@ void loop(void)
|
|||
static uint8_t rcSticks; // this hold sticks position for command combos
|
||||
uint8_t stTmp = 0;
|
||||
int i;
|
||||
static uint32_t rcTime = 0;
|
||||
#ifdef BARO
|
||||
static int16_t initialThrottleHold;
|
||||
#endif
|
||||
static uint32_t loopTime;
|
||||
uint16_t auxState = 0;
|
||||
bool isThrottleLow = false;
|
||||
bool rcReady = false;
|
||||
|
||||
// calculate rc stuff from serial-based receivers (spek/sbus)
|
||||
if (feature(FEATURE_RX_SERIAL)) {
|
||||
rcReady = isSerialRxFrameComplete(&masterConfig.rxConfig);
|
||||
}
|
||||
updateRx();
|
||||
|
||||
if (feature(FEATURE_RX_MSP)) {
|
||||
rcReady = rxMspFrameComplete();
|
||||
}
|
||||
|
||||
if (((int32_t)(currentTime - rcTime) >= 0) || rcReady) { // 50Hz or data driven
|
||||
rcReady = false;
|
||||
rcTime = currentTime + 20000;
|
||||
computeRC(&masterConfig.rxConfig, &rxRuntimeConfig);
|
||||
if (shouldProcessRx(currentTime)) {
|
||||
calculateRxChannelsAndUpdateFailsafe(currentTime);
|
||||
|
||||
// in 3D mode, we need to be able to disarm by switch at any time
|
||||
if (feature(FEATURE_3D)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue