From 90dd36285ea8f110c45322bb43f6f00223aaf6a9 Mon Sep 17 00:00:00 2001 From: Iampete1 Date: Tue, 21 Sep 2021 22:21:50 +0100 Subject: [PATCH] Plane: support TRIM_TO_CURRENT_SERVO_RC RC option to trigger trim radio function --- ArduPlane/RC_Channel.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ArduPlane/RC_Channel.cpp b/ArduPlane/RC_Channel.cpp index 058e13f64e..93540d7f9e 100644 --- a/ArduPlane/RC_Channel.cpp +++ b/ArduPlane/RC_Channel.cpp @@ -163,6 +163,7 @@ void RC_Channel_Plane::init_aux_function(const RC_Channel::aux_func_t ch_option, #if HAL_QUADPLANE_ENABLED case AUX_FUNC::ARMDISARM_AIRMODE: #endif + case AUX_FUNC::TRIM_TO_CURRENT_SERVO_RC: break; case AUX_FUNC::SOARING: @@ -347,6 +348,13 @@ case AUX_FUNC::ARSPD_CALIBRATE: break; #endif + case AUX_FUNC::TRIM_TO_CURRENT_SERVO_RC: + if (ch_flag == AuxSwitchPos::HIGH) { + plane.trim_radio(); + } + break; + + default: return RC_Channel::do_aux_function(ch_option, ch_flag); }