From c38e5ba4fc1c34203539440de724f413ba012c7e Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 3 May 2019 21:26:28 +1000 Subject: [PATCH] RC_Channel: handle AUX_FUNC::ARMDISARM --- libraries/RC_Channel/RC_Channel.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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();