From 6f7c442fa55215d4c0e7ab88420cd38a8c5123e4 Mon Sep 17 00:00:00 2001 From: Tom Pittenger Date: Tue, 23 Apr 2024 15:32:30 -0700 Subject: [PATCH] Plane: NAV_ALTITUDE_WAIT to set servos of all control surfaces --- ArduPlane/servos.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ArduPlane/servos.cpp b/ArduPlane/servos.cpp index cc4d4dde104e38..caeacec2e918c8 100644 --- a/ArduPlane/servos.cpp +++ b/ArduPlane/servos.cpp @@ -378,10 +378,17 @@ void ModeAuto::wiggle_servos() wiggle.stage = 0; servo_value = 0; } - SRV_Channels::set_output_scaled(SRV_Channel::k_aileron, servo_value); - SRV_Channels::set_output_scaled(SRV_Channel::k_elevator, servo_value); - SRV_Channels::set_output_scaled(SRV_Channel::k_rudder, servo_value); + for (uint8_t i = 0; i < NUM_SERVO_CHANNELS ; i++) { + const SRV_Channel *chan = SRV_Channels::srv_channel(i); + if (chan == nullptr) { + continue; + } + const SRV_Channel::Aux_servo_function_t func = chan->get_function(); + if (SRV_Channel::is_control_surface(func)) { + SRV_Channels::set_output_scaled(func, servo_value); + } + } }