From 20015c60a73a5b579e6296eca43e65ecedc68766 Mon Sep 17 00:00:00 2001 From: Iampete1 Date: Sat, 24 Feb 2024 23:39:11 +0000 Subject: [PATCH] Plane: Quadplane: move disable of assistance in flare to `should_assist` function --- ArduPlane/RC_Channel.cpp | 9 --------- ArduPlane/quadplane.cpp | 6 ++++++ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/ArduPlane/RC_Channel.cpp b/ArduPlane/RC_Channel.cpp index 069038960e..3d0caaec35 100644 --- a/ArduPlane/RC_Channel.cpp +++ b/ArduPlane/RC_Channel.cpp @@ -121,20 +121,11 @@ void RC_Channel_Plane::do_aux_function_flare(AuxSwitchPos ch_flag) switch(ch_flag) { case AuxSwitchPos::HIGH: plane.flare_mode = Plane::FlareMode::ENABLED_PITCH_TARGET; -#if HAL_QUADPLANE_ENABLED - plane.quadplane.assist.set_state(QuadPlane::VTOL_Assist::STATE::ASSIST_DISABLED); -#endif break; case AuxSwitchPos::MIDDLE: plane.flare_mode = Plane::FlareMode::ENABLED_NO_PITCH_TARGET; -#if HAL_QUADPLANE_ENABLED - plane.quadplane.assist.set_state(QuadPlane::VTOL_Assist::STATE::ASSIST_DISABLED); -#endif break; case AuxSwitchPos::LOW: -#if HAL_QUADPLANE_ENABLED - plane.quadplane.assist.set_state(QuadPlane::VTOL_Assist::STATE::ASSIST_ENABLED); -#endif plane.flare_mode = Plane::FlareMode::FLARE_DISABLED; break; } diff --git a/ArduPlane/quadplane.cpp b/ArduPlane/quadplane.cpp index a200dd95c9..ab864ac260 100644 --- a/ArduPlane/quadplane.cpp +++ b/ArduPlane/quadplane.cpp @@ -1481,6 +1481,12 @@ bool QuadPlane::VTOL_Assist::should_assist(float aspeed, bool have_airspeed) return false; } + if (plane.flare_mode != Plane::FlareMode::FLARE_DISABLED) { + // Never active in fixed wing flare + reset(); + return false; + } + if (state == STATE::FORCE_ENABLED) { // force enabled, no need to check thresholds reset();