mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 17:25:20 +03:00
Constrain invalid values by using rx_min_usec and rc_max_usec. Provide
sensible/fix min/max settings for those settings. This fixes erratic flight behaviour before failsafe kicks in on SBus receivers. An X8R SBus RX in failsafe mode outputs 880 on all channels. See #918 and #919
This commit is contained in:
parent
22bf890cf0
commit
7a01bab50f
3 changed files with 6 additions and 6 deletions
|
@ -75,9 +75,6 @@ int16_t rcData[MAX_SUPPORTED_RC_CHANNEL_COUNT]; // interval [1000;2000]
|
|||
|
||||
#define PPM_AND_PWM_SAMPLE_COUNT 4
|
||||
|
||||
#define PULSE_MIN 750 // minimum PWM pulse width which is considered valid
|
||||
#define PULSE_MAX 2250 // maximum PWM pulse width which is considered valid
|
||||
|
||||
#define DELAY_50_HZ (1000000 / 50)
|
||||
#define DELAY_10_HZ (1000000 / 10)
|
||||
|
||||
|
@ -336,7 +333,7 @@ static void processRxChannels(void)
|
|||
}
|
||||
|
||||
// validate the range
|
||||
if (sample < PULSE_MIN || sample > PULSE_MAX)
|
||||
if (sample < rxConfig->rx_min_usec || sample > rxConfig->rx_max_usec)
|
||||
sample = rxConfig->midrc;
|
||||
|
||||
if (isRxDataDriven()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue