diff options
author | px4dev <px4@purgatory.org> | 2013-01-26 13:16:24 -0800 |
---|---|---|
committer | px4dev <px4@purgatory.org> | 2013-01-26 13:16:24 -0800 |
commit | 4ab490bd5017c6dd132b4422aecda597a5c8cd38 (patch) | |
tree | 7573cc02a1eb8313de46c678da41018f76c38b50 /apps | |
parent | 4ea8a64b395026d7df8739bc6c76ea121ee6b977 (diff) | |
download | px4-firmware-4ab490bd5017c6dd132b4422aecda597a5c8cd38.tar.gz px4-firmware-4ab490bd5017c6dd132b4422aecda597a5c8cd38.tar.bz2 px4-firmware-4ab490bd5017c6dd132b4422aecda597a5c8cd38.zip |
Only update the servo output values when we are armed.
Diffstat (limited to 'apps')
-rw-r--r-- | apps/px4io/mixer.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/px4io/mixer.cpp b/apps/px4io/mixer.cpp index 91a914575..79b32009e 100644 --- a/apps/px4io/mixer.cpp +++ b/apps/px4io/mixer.cpp @@ -221,12 +221,6 @@ mixer_tick(void) #endif /* - * Update the servo outputs. - */ - for (unsigned i = 0; i < IO_SERVO_COUNT; i++) - up_pwm_servo_set(i, r_page_servos[i]); - - /* * Decide whether the servos should be armed right now. * * We must be armed, and we must have a PWM source; either raw from @@ -243,6 +237,12 @@ 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); |