diff --git a/Rover/RC_Channel.cpp b/Rover/RC_Channel.cpp index cadd5488f5..f052c45a04 100644 --- a/Rover/RC_Channel.cpp +++ b/Rover/RC_Channel.cpp @@ -125,7 +125,7 @@ void RC_Channel_Rover::do_aux_function_sailboat_motor_3pos(const AuxSwitchPos ch } } -void RC_Channel_Rover::do_aux_function(const aux_func_t ch_option, const AuxSwitchPos ch_flag) +bool RC_Channel_Rover::do_aux_function(const aux_func_t ch_option, const AuxSwitchPos ch_flag) { switch (ch_option) { case AUX_FUNC::DO_NOTHING: @@ -134,7 +134,7 @@ void RC_Channel_Rover::do_aux_function(const aux_func_t ch_option, const AuxSwit if (ch_flag == AuxSwitchPos::HIGH) { // do nothing if in AUTO mode if (rover.control_mode == &rover.mode_auto) { - return; + break; } // if disarmed clear mission and set home to current location @@ -143,7 +143,7 @@ void RC_Channel_Rover::do_aux_function(const aux_func_t ch_option, const AuxSwit if (!rover.set_home_to_current_location(false)) { // ignored } - return; + break; } // record the waypoint if not in auto mode @@ -248,8 +248,9 @@ void RC_Channel_Rover::do_aux_function(const aux_func_t ch_option, const AuxSwit break; default: - RC_Channel::do_aux_function(ch_option, ch_flag); - break; + return RC_Channel::do_aux_function(ch_option, ch_flag); } + + return true; } diff --git a/Rover/RC_Channel.h b/Rover/RC_Channel.h index d06854e61f..844b4c1b90 100644 --- a/Rover/RC_Channel.h +++ b/Rover/RC_Channel.h @@ -12,7 +12,7 @@ public: protected: void init_aux_function(aux_func_t ch_option, AuxSwitchPos) override; - void do_aux_function(aux_func_t ch_option, AuxSwitchPos) override; + bool do_aux_function(aux_func_t ch_option, AuxSwitchPos) override; // called when the mode switch changes position: void mode_switch_changed(modeswitch_pos_t new_pos) override;