Browse Source

ArduPlane: return MAV_RESULT_FAILED from do_aux_function if invalid function

zr-v5.1
Peter Barker 4 years ago committed by Peter Barker
parent
commit
cb8ca17035
  1. 7
      ArduPlane/RC_Channel.cpp
  2. 2
      ArduPlane/RC_Channel.h

7
ArduPlane/RC_Channel.cpp

@ -199,7 +199,7 @@ void RC_Channel_Plane::init_aux_function(const RC_Channel::aux_func_t ch_option,
} }
// do_aux_function - implement the function invoked by auxillary switches // do_aux_function - implement the function invoked by auxillary switches
void RC_Channel_Plane::do_aux_function(const aux_func_t ch_option, const AuxSwitchPos ch_flag) bool RC_Channel_Plane::do_aux_function(const aux_func_t ch_option, const AuxSwitchPos ch_flag)
{ {
switch(ch_option) { switch(ch_option) {
case AUX_FUNC::INVERTED: case AUX_FUNC::INVERTED:
@ -325,7 +325,8 @@ case AUX_FUNC::ARSPD_CALIBRATE:
break; break;
default: default:
RC_Channel::do_aux_function(ch_option, ch_flag); return RC_Channel::do_aux_function(ch_option, ch_flag);
break;
} }
return true;
} }

2
ArduPlane/RC_Channel.h

@ -11,7 +11,7 @@ protected:
void init_aux_function(aux_func_t ch_option, void init_aux_function(aux_func_t ch_option,
AuxSwitchPos ch_flag) override; AuxSwitchPos ch_flag) override;
void do_aux_function(aux_func_t ch_option, AuxSwitchPos) override; bool do_aux_function(aux_func_t ch_option, AuxSwitchPos) override;
private: private:

Loading…
Cancel
Save