From 850d47752f494cd4e5f3e79629e89589025f8dbd Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Sun, 17 Apr 2022 12:54:08 +1000 Subject: [PATCH] GCS_MAVLink: allow FRSky to be compiled out --- libraries/GCS_MAVLink/GCS.h | 3 +++ libraries/GCS_MAVLink/GCS_Common.cpp | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/libraries/GCS_MAVLink/GCS.h b/libraries/GCS_MAVLink/GCS.h index 1481c606a4..bdc94f3828 100644 --- a/libraries/GCS_MAVLink/GCS.h +++ b/libraries/GCS_MAVLink/GCS.h @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -1098,8 +1099,10 @@ public: bool out_of_time() const; +#if AP_FRSKY_TELEM_ENABLED // frsky backend class AP_Frsky_Telem *frsky; +#endif #if AP_LTM_TELEM_ENABLED // LTM backend diff --git a/libraries/GCS_MAVLink/GCS_Common.cpp b/libraries/GCS_MAVLink/GCS_Common.cpp index d99d7e5d6a..758511026b 100644 --- a/libraries/GCS_MAVLink/GCS_Common.cpp +++ b/libraries/GCS_MAVLink/GCS_Common.cpp @@ -2060,10 +2060,12 @@ void GCS::send_textv(MAV_SEVERITY severity, const char *fmt, va_list arg_list, u logger->Write_Message(first_piece_of_text); } +#if AP_FRSKY_TELEM_ENABLED frsky = AP::frsky_telem(); if (frsky != nullptr) { frsky->queue_message(severity, first_piece_of_text); } +#endif #if HAL_SPEKTRUM_TELEM_ENABLED AP_Spektrum_Telem* spektrum = AP::spektrum_telem(); if (spektrum != nullptr) { @@ -2316,6 +2318,7 @@ void GCS::setup_uarts() create_gcs_mavlink_backend(chan_parameters[i], *uart); } +#if AP_FRSKY_TELEM_ENABLED if (frsky == nullptr) { frsky = new AP_Frsky_Telem(); if (frsky == nullptr || !frsky->init()) { @@ -2323,6 +2326,8 @@ void GCS::setup_uarts() frsky = nullptr; } } +#endif + #if AP_LTM_TELEM_ENABLED ltm_telemetry.init(); #endif