From a8d11db49042a01f4cd4edcd713911f9b621c836 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Sat, 2 Sep 2023 15:21:35 +1000 Subject: [PATCH] AP_RCTelemetry: allow more libraries to compile with no HAL_GCS_ENABLED --- libraries/AP_RCTelemetry/AP_RCTelemetry.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libraries/AP_RCTelemetry/AP_RCTelemetry.cpp b/libraries/AP_RCTelemetry/AP_RCTelemetry.cpp index efc5b26e32..c57c3d35ce 100644 --- a/libraries/AP_RCTelemetry/AP_RCTelemetry.cpp +++ b/libraries/AP_RCTelemetry/AP_RCTelemetry.cpp @@ -39,7 +39,7 @@ extern const AP_HAL::HAL& hal; */ bool AP_RCTelemetry::init(void) { -#if !APM_BUILD_TYPE(APM_BUILD_UNKNOWN) +#if HAL_GCS_ENABLED && !APM_BUILD_TYPE(APM_BUILD_UNKNOWN) // make telemetry available to GCS_MAVLINK (used to queue statustext messages from GCS_MAVLINK) // add firmware and frame info to message queue const char* _frame_string = gcs().frame_string(); @@ -283,7 +283,13 @@ uint32_t AP_RCTelemetry::sensor_status_flags() const uint32_t present; uint32_t enabled; uint32_t health; +#if HAL_GCS_ENABLED gcs().get_sensor_status_flags(present, enabled, health); +#else + present = 0; + enabled = 0; + health = 0; +#endif return ~health & enabled & present; }