aboutsummaryrefslogtreecommitdiff
path: root/apps/px4io/mixer.cpp
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2013-02-12 22:19:53 +0100
committerLorenz Meier <lm@inf.ethz.ch>2013-02-12 22:19:53 +0100
commitd4ca6a29a19c96d359aa1458a4e6f3d9c86b01ac (patch)
tree7b23cc482ac6a8a067a9200deff601d1f8e83a8f /apps/px4io/mixer.cpp
parent4af4d1cf2125a173db3d358d84bb34eebb17d446 (diff)
downloadpx4-firmware-d4ca6a29a19c96d359aa1458a4e6f3d9c86b01ac.tar.gz
px4-firmware-d4ca6a29a19c96d359aa1458a4e6f3d9c86b01ac.tar.bz2
px4-firmware-d4ca6a29a19c96d359aa1458a4e6f3d9c86b01ac.zip
Ensured that the mixer output obeys the FMU and IO armed state
Diffstat (limited to 'apps/px4io/mixer.cpp')
-rw-r--r--apps/px4io/mixer.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/px4io/mixer.cpp b/apps/px4io/mixer.cpp
index 848a88621..740d8aeb0 100644
--- a/apps/px4io/mixer.cpp
+++ b/apps/px4io/mixer.cpp
@@ -231,8 +231,9 @@ mixer_tick(void)
* XXX correct behaviour for failsafe may require an additional case
* here.
*/
- bool should_arm = ((r_status_flags & PX4IO_P_STATUS_FLAGS_ARMED) &&
- (r_status_flags & (PX4IO_P_STATUS_FLAGS_RAW_PWM | PX4IO_P_STATUS_FLAGS_MIXER_OK)));
+ bool should_arm = (/* 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)));
if (should_arm && !mixer_servos_armed) {
/* need to arm, but not armed */