diff --git a/libraries/RC_Channel/RC_Channel.cpp b/libraries/RC_Channel/RC_Channel.cpp index ce94b57e96..dcbb3c071b 100644 --- a/libraries/RC_Channel/RC_Channel.cpp +++ b/libraries/RC_Channel/RC_Channel.cpp @@ -35,6 +35,7 @@ extern const AP_HAL::HAL& hal; #include #include #include +#include const AP_Param::GroupInfo RC_Channel::var_info[] = { // @Param: MIN @@ -679,6 +680,21 @@ void RC_Channel::do_aux_function(const aux_func_t ch_option, const aux_switch_po do_aux_function_lost_vehicle_sound(ch_flag); break; + case AUX_FUNC::ARMDISARM: + // arm or disarm the vehicle + switch (ch_flag) { + case HIGH: + AP::arming().arm(AP_Arming::Method::AUXSWITCH, true); + break; + case MIDDLE: + // nothing + break; + case LOW: + AP::arming().disarm(); + break; + } + break; + case AUX_FUNC::COMPASS_LEARN: if (ch_flag == HIGH) { Compass &compass = AP::compass();