aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Oes <joes@student.ethz.ch>2013-03-15 15:24:52 -0700
committerJulian Oes <joes@student.ethz.ch>2013-03-15 15:24:52 -0700
commitb5b460e7ca7339bce024697bed076a8362f9dc67 (patch)
treef5fae2dcb7d4ed89aeeb004f6612824aba481afc
parent37c1f3059814a6f77228482e0f5cad97591b0db8 (diff)
downloadpx4-firmware-b5b460e7ca7339bce024697bed076a8362f9dc67.tar.gz
px4-firmware-b5b460e7ca7339bce024697bed076a8362f9dc67.tar.bz2
px4-firmware-b5b460e7ca7339bce024697bed076a8362f9dc67.zip
IO board now disarms when FMU reboots when manual override is not an option
-rw-r--r--apps/px4io/mixer.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/px4io/mixer.cpp b/apps/px4io/mixer.cpp
index ec69cdd64..f38593d2a 100644
--- a/apps/px4io/mixer.cpp
+++ b/apps/px4io/mixer.cpp
@@ -93,13 +93,11 @@ mixer_tick(void)
/* too long without FMU input, time to go to failsafe */
if (r_status_flags & PX4IO_P_STATUS_FLAGS_FMU_OK) {
- lowsyslog("AP RX timeout");
+ isr_debug(1, "AP RX timeout");
}
r_status_flags &= ~(PX4IO_P_STATUS_FLAGS_FMU_OK | PX4IO_P_STATUS_FLAGS_RAW_PWM);
r_status_alarms |= PX4IO_P_STATUS_ALARMS_FMU_LOST;
- /* XXX this is questionable - vehicle may not make sense for direct control */
- r_status_flags |= PX4IO_P_STATUS_FLAGS_OVERRIDE;
} else {
r_status_flags |= PX4IO_P_STATUS_FLAGS_FMU_OK;
r_status_alarms &= ~PX4IO_P_STATUS_ALARMS_FMU_LOST;
@@ -179,7 +177,10 @@ mixer_tick(void)
/* FMU is armed */ (r_setup_arming & PX4IO_P_SETUP_ARMING_ARM_OK) &&
/* IO is armed */ (r_status_flags & PX4IO_P_STATUS_FLAGS_ARMED) &&
/* there is valid input */ (r_status_flags & (PX4IO_P_STATUS_FLAGS_RAW_PWM | PX4IO_P_STATUS_FLAGS_MIXER_OK)) &&
- /* IO initialised without error */ (r_status_flags & PX4IO_P_STATUS_FLAGS_INIT_OK));
+ /* IO initialised without error */ (r_status_flags & PX4IO_P_STATUS_FLAGS_INIT_OK) &&
+ /* FMU is available or FMU is not available but override is an option */
+ ((r_status_flags & PX4IO_P_STATUS_FLAGS_FMU_OK) || (!(r_status_flags & PX4IO_P_STATUS_FLAGS_FMU_OK) && (r_setup_arming & PX4IO_P_SETUP_ARMING_MANUAL_OVERRIDE_OK) ))
+ );
if (should_arm && !mixer_servos_armed) {
/* need to arm, but not armed */