Plane: support TRIM_TO_CURRENT_SERVO_RC RC option to trigger trim radio function

This commit is contained in:
Iampete1 2021-09-21 22:21:50 +01:00 committed by Andrew Tridgell
parent cbfa4e5746
commit 90dd36285e

View File

@ -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);
}