From a9b5068fbefe78e44cb08e0b29b2fa7a8ac0359b Mon Sep 17 00:00:00 2001 From: Iampete1 Date: Fri, 13 Dec 2024 21:15:47 +0000 Subject: [PATCH] Rover: move to AuxFuncTrigger structure --- Rover/RC_Channel.cpp | 7 +++++-- Rover/RC_Channel.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Rover/RC_Channel.cpp b/Rover/RC_Channel.cpp index 75cd088a75..3bb7db0385 100644 --- a/Rover/RC_Channel.cpp +++ b/Rover/RC_Channel.cpp @@ -130,8 +130,11 @@ void RC_Channel_Rover::do_aux_function_sailboat_motor_3pos(const AuxSwitchPos ch } } -bool RC_Channel_Rover::do_aux_function(const AUX_FUNC ch_option, const AuxSwitchPos ch_flag) +bool RC_Channel_Rover::do_aux_function(const AuxFuncTrigger &trigger) { + const AUX_FUNC &ch_option = trigger.func; + const AuxSwitchPos &ch_flag = trigger.pos; + switch (ch_option) { case AUX_FUNC::DO_NOTHING: break; @@ -261,7 +264,7 @@ bool RC_Channel_Rover::do_aux_function(const AUX_FUNC ch_option, const AuxSwitch break; default: - return RC_Channel::do_aux_function(ch_option, ch_flag); + return RC_Channel::do_aux_function(trigger); } diff --git a/Rover/RC_Channel.h b/Rover/RC_Channel.h index 01c83da59b..ae4c4b60c8 100644 --- a/Rover/RC_Channel.h +++ b/Rover/RC_Channel.h @@ -12,7 +12,7 @@ public: protected: void init_aux_function(AUX_FUNC ch_option, AuxSwitchPos) override; - bool do_aux_function(AUX_FUNC ch_option, AuxSwitchPos) override; + bool do_aux_function(const AuxFuncTrigger &trigger) override; // called when the mode switch changes position: void mode_switch_changed(modeswitch_pos_t new_pos) override;