diff options
author | px4dev <px4@purgatory.org> | 2013-01-26 16:37:35 -0800 |
---|---|---|
committer | px4dev <px4@purgatory.org> | 2013-01-26 16:37:35 -0800 |
commit | 7864176b5a1f2ac9cde4ac29ef19c5a72f87b3d3 (patch) | |
tree | 550f4590b0ff79e19377f6a2997b1b4bdfc14783 /apps/px4io/mixer.cpp | |
parent | c0a46c4b93d29a438a6207ce49589bddc026c900 (diff) | |
download | px4-firmware-7864176b5a1f2ac9cde4ac29ef19c5a72f87b3d3.tar.gz px4-firmware-7864176b5a1f2ac9cde4ac29ef19c5a72f87b3d3.tar.bz2 px4-firmware-7864176b5a1f2ac9cde4ac29ef19c5a72f87b3d3.zip |
A couple of logic fixes from Tridge.
Diffstat (limited to 'apps/px4io/mixer.cpp')
-rw-r--r-- | apps/px4io/mixer.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/apps/px4io/mixer.cpp b/apps/px4io/mixer.cpp index 79b32009e..848a88621 100644 --- a/apps/px4io/mixer.cpp +++ b/apps/px4io/mixer.cpp @@ -91,10 +91,12 @@ mixer_tick(void) if ((hrt_absolute_time() - system_state.fmu_data_received_time) > FMU_INPUT_DROP_LIMIT_US) { /* too long without FMU input, time to go to failsafe */ + if (r_status_flags & PX4IO_P_STATUS_FLAGS_FMU_OK) { + debug("AP RX timeout"); + } r_status_flags |= PX4IO_P_STATUS_FLAGS_OVERRIDE; r_status_flags &= ~(PX4IO_P_STATUS_FLAGS_FMU_OK | PX4IO_P_STATUS_FLAGS_RAW_PWM); r_status_alarms |= PX4IO_P_STATUS_ALARMS_FMU_LOST; - debug("AP RX timeout"); } source = MIX_FAILSAFE; @@ -237,17 +239,17 @@ mixer_tick(void) up_pwm_servo_arm(true); mixer_servos_armed = true; - /* - * Update the servo outputs. - */ - for (unsigned i = 0; i < IO_SERVO_COUNT; i++) - up_pwm_servo_set(i, r_page_servos[i]); - } else if (!should_arm && mixer_servos_armed) { /* armed but need to disarm */ up_pwm_servo_arm(false); mixer_servos_armed = false; } + + if (mixer_servos_armed) { + /* update the servo outputs. */ + for (unsigned i = 0; i < IO_SERVO_COUNT; i++) + up_pwm_servo_set(i, r_page_servos[i]); + } } static int |