|
|
|
@ -26,3 +26,40 @@ bool RC_Channels_Plane::has_valid_input() const
@@ -26,3 +26,40 @@ bool RC_Channels_Plane::has_valid_input() const
|
|
|
|
|
} |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void RC_Channel_Plane::init_aux_function(const RC_Channel::aux_func_t ch_option, |
|
|
|
|
const RC_Channel::aux_switch_pos_t ch_flag) |
|
|
|
|
{ |
|
|
|
|
switch(ch_option) { |
|
|
|
|
// the following functions do not need to be initialised:
|
|
|
|
|
case ARMDISARM: |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
RC_Channel::init_aux_function(ch_option, ch_flag); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// do_aux_function - implement the function invoked by auxillary switches
|
|
|
|
|
void RC_Channel_Plane::do_aux_function(const aux_func_t ch_option, const aux_switch_pos_t ch_flag) |
|
|
|
|
{ |
|
|
|
|
switch(ch_option) { |
|
|
|
|
case ARMDISARM: |
|
|
|
|
// arm or disarm the vehicle
|
|
|
|
|
switch (ch_flag) { |
|
|
|
|
case HIGH: |
|
|
|
|
plane.arm_motors(AP_Arming::ArmingMethod::AUXSWITCH, true); |
|
|
|
|
break; |
|
|
|
|
case MIDDLE: |
|
|
|
|
// nothing
|
|
|
|
|
break; |
|
|
|
|
case LOW: |
|
|
|
|
plane.disarm_motors(); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
RC_Channel::do_aux_function(ch_option, ch_flag); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|