diff --git a/libraries/RC_Channel/RC_Channel.cpp b/libraries/RC_Channel/RC_Channel.cpp index 3c6bc11b4e7ad4..63b26ea559de10 100644 --- a/libraries/RC_Channel/RC_Channel.cpp +++ b/libraries/RC_Channel/RC_Channel.cpp @@ -1967,11 +1967,11 @@ RC_Channel::AuxSwitchPos RC_Channel::get_stick_gesture_pos() const if (in < RC_Channel::AUX_PWM_TRIGGER_LOW) { return switch_reversed ? RC_Channel::AuxSwitchPos::HIGH : RC_Channel::AuxSwitchPos::LOW; - } else if (in > RC_Channel::AUX_PWM_TRIGGER_HIGH) { + } + if (in > RC_Channel::AUX_PWM_TRIGGER_HIGH) { return switch_reversed ? RC_Channel::AuxSwitchPos::LOW : RC_Channel::AuxSwitchPos::HIGH; - } else { - return RC_Channel::AuxSwitchPos::MIDDLE; - } + } + return RC_Channel::AuxSwitchPos::MIDDLE; } RC_Channel *RC_Channels::find_channel_for_option(const RC_Channel::AUX_FUNC option)