diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-08-28 20:36:59 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-08-28 20:36:59 +0200 |
commit | c85d7aae06b49f43e32dde05c00bcee1310aee9f (patch) | |
tree | b49af08ef49c1aec510274c6c776a565d3891343 /src/modules | |
parent | 91d50301c61cf495e83cab59621ef83cff24da3a (diff) | |
download | px4-firmware-c85d7aae06b49f43e32dde05c00bcee1310aee9f.tar.gz px4-firmware-c85d7aae06b49f43e32dde05c00bcee1310aee9f.tar.bz2 px4-firmware-c85d7aae06b49f43e32dde05c00bcee1310aee9f.zip |
Make sure we got to valid input at least once before kicking in failsafe
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/px4iofirmware/mixer.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/modules/px4iofirmware/mixer.cpp b/src/modules/px4iofirmware/mixer.cpp index 0c65b7642..17751bd6d 100644 --- a/src/modules/px4iofirmware/mixer.cpp +++ b/src/modules/px4iofirmware/mixer.cpp @@ -71,6 +71,7 @@ extern "C" { static bool mixer_servos_armed = false; static bool should_arm = false; static bool should_always_enable_pwm = false; +static bool input_valid_initialized = false; /* the input was valid at least once */ static volatile bool in_mixer = false; /* selected control values and count for mixing */ @@ -162,7 +163,8 @@ mixer_tick(void) * failsafe condition. */ if ((r_setup_arming & PX4IO_P_SETUP_ARMING_TERMINATION_FAILSAFE) && - (source == MIX_FAILSAFE)) { + (source == MIX_FAILSAFE) && + input_valid_initialized) { r_setup_arming |= PX4IO_P_SETUP_ARMING_FORCE_FAILSAFE; } @@ -180,6 +182,9 @@ mixer_tick(void) r_status_flags |= PX4IO_P_STATUS_FLAGS_FAILSAFE; } else { r_status_flags &= ~(PX4IO_P_STATUS_FLAGS_FAILSAFE); + + /* we got valid input, kick off the full failsafe checks */ + input_valid_initialized = true; } /* |