diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2012-12-13 11:12:34 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2012-12-13 11:12:34 +0100 |
commit | 1fc0a6546e30cfc913de8c0c03cfc625fba5d2ae (patch) | |
tree | 65cf4f9b03e9dc63ffdf05ff698272f326d76908 /apps/px4io/mixer.c | |
parent | 26faab64e5e1679d15afe88ef0edebd598f47dc7 (diff) | |
parent | 03076a72ca75917cf62d7889c6c6d0de36866b04 (diff) | |
download | px4-firmware-1fc0a6546e30cfc913de8c0c03cfc625fba5d2ae.tar.gz px4-firmware-1fc0a6546e30cfc913de8c0c03cfc625fba5d2ae.tar.bz2 px4-firmware-1fc0a6546e30cfc913de8c0c03cfc625fba5d2ae.zip |
Merged IO feature branch
Diffstat (limited to 'apps/px4io/mixer.c')
-rw-r--r-- | apps/px4io/mixer.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/px4io/mixer.c b/apps/px4io/mixer.c index 4fa3e1d5d..5a644906b 100644 --- a/apps/px4io/mixer.c +++ b/apps/px4io/mixer.c @@ -85,7 +85,7 @@ mixer_tick(void) /* * Decide which set of inputs we're using. */ - if (system_state.mixer_use_fmu && system_state.mixer_fmu_available) { + if (!system_state.mixer_manual_override && system_state.mixer_fmu_available) { /* we have recent control data from the FMU */ control_count = PX4IO_OUTPUT_CHANNELS; control_values = &system_state.fmu_channel_data[0]; @@ -96,21 +96,22 @@ mixer_tick(void) /* too many frames without FMU input, time to go to failsafe */ if (fmu_input_drops >= FMU_INPUT_DROP_LIMIT) { - system_state.mixer_use_fmu = false; + system_state.mixer_manual_override = true; + system_state.mixer_fmu_available = false; } } else { fmu_input_drops = 0; system_state.fmu_data_received = false; } - } else if (system_state.rc_channels > 0) { + } else if (system_state.rc_channels > 0 && system_state.manual_override_ok) { /* we have control data from an R/C input */ control_count = system_state.rc_channels; control_values = &system_state.rc_channel_data[0]; - } else { /* we have no control input */ - /* XXX builtin failsafe would activate here */ + + // XXX builtin failsafe would activate here control_count = 0; } |