diff --git a/libraries/AP_Motors/AP_MotorsHeli_Quad.cpp b/libraries/AP_Motors/AP_MotorsHeli_Quad.cpp index 371baa2a0e..e7062221fc 100644 --- a/libraries/AP_Motors/AP_MotorsHeli_Quad.cpp +++ b/libraries/AP_Motors/AP_MotorsHeli_Quad.cpp @@ -70,7 +70,7 @@ bool AP_MotorsHeli_Quad::init_outputs() } for (uint8_t i=0; i= 0 && motor_num < AP_MOTORS_MAX_NUM_MOTORS ) { uint8_t chan; - SRV_Channel::Aux_servo_function_t function; - if (motor_num < 8) { - function = (SRV_Channel::Aux_servo_function_t)(SRV_Channel::k_motor1+motor_num); - } else { - function = (SRV_Channel::Aux_servo_function_t)(SRV_Channel::k_motor9+(motor_num-8)); - } + SRV_Channel::Aux_servo_function_t function = SRV_Channels::get_motor_function(motor_num); SRV_Channels::set_aux_channel_default(function, motor_num); if (!SRV_Channels::find_channel(function, chan)) { gcs().send_text(MAV_SEVERITY_ERROR, "Motors: unable to setup motor %u", motor_num);