From 10591837585871413b40303098ea84629aa226aa Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 27 Oct 2023 18:26:20 +1100 Subject: [PATCH] ArduCopter: tidy sending of winch messages --- ArduCopter/GCS_Mavlink.cpp | 4 ++-- ArduCopter/GCS_Mavlink.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ArduCopter/GCS_Mavlink.cpp b/ArduCopter/GCS_Mavlink.cpp index e3cd717a49..62fd79b97e 100644 --- a/ArduCopter/GCS_Mavlink.cpp +++ b/ArduCopter/GCS_Mavlink.cpp @@ -311,17 +311,17 @@ void GCS_MAVLINK_Copter::send_pid_tuning() } } +#if AP_WINCH_ENABLED // send winch status message void GCS_MAVLINK_Copter::send_winch_status() const { -#if AP_WINCH_ENABLED AP_Winch *winch = AP::winch(); if (winch == nullptr) { return; } winch->send_status(*this); -#endif } +#endif uint8_t GCS_MAVLINK_Copter::sysid_my_gcs() const { diff --git a/ArduCopter/GCS_Mavlink.h b/ArduCopter/GCS_Mavlink.h index 7470434f43..d042d3000e 100644 --- a/ArduCopter/GCS_Mavlink.h +++ b/ArduCopter/GCS_Mavlink.h @@ -83,7 +83,9 @@ private: void send_pid_tuning() override; +#if AP_WINCH_ENABLED void send_winch_status() const override; +#endif void send_wind() const;