From 2dacafe0f3c67909f8804e14be9eac28f030efd8 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Sun, 1 Dec 2019 10:37:28 +1100 Subject: [PATCH] AP_Landing: emit DEPLOY gcs text only if not already deployed --- libraries/AP_LandingGear/AP_LandingGear.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libraries/AP_LandingGear/AP_LandingGear.cpp b/libraries/AP_LandingGear/AP_LandingGear.cpp index a6e655a954..5fa9b42a4b 100644 --- a/libraries/AP_LandingGear/AP_LandingGear.cpp +++ b/libraries/AP_LandingGear/AP_LandingGear.cpp @@ -122,14 +122,15 @@ void AP_LandingGear::deploy() // set servo PWM to deployed position SRV_Channels::set_output_limit(SRV_Channel::k_landing_gear_control, SRV_Channel::Limit::MAX); + // send message only if output has been configured + if (!_deployed && + SRV_Channels::function_assigned(SRV_Channel::k_landing_gear_control)) { + gcs().send_text(MAV_SEVERITY_INFO, "LandingGear: DEPLOY"); + } + // set deployed flag _deployed = true; _have_changed = true; - - // send message only if output has been configured - if (SRV_Channels::function_assigned(SRV_Channel::k_landing_gear_control)) { - gcs().send_text(MAV_SEVERITY_INFO, "LandingGear: DEPLOY"); - } } /// retract - retract landing gear