From 65d4b6377e32ddffaf0531d5aec72ce0d4119762 Mon Sep 17 00:00:00 2001 From: Josh Henderson Date: Mon, 1 Nov 2021 04:15:51 -0400 Subject: [PATCH] AP_LTM_Telem: add define AP_AIRSPEED_ENABLED --- libraries/AP_LTM_Telem/AP_LTM_Telem.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/AP_LTM_Telem/AP_LTM_Telem.cpp b/libraries/AP_LTM_Telem/AP_LTM_Telem.cpp index e9fac89275..83e6abe6f1 100644 --- a/libraries/AP_LTM_Telem/AP_LTM_Telem.cpp +++ b/libraries/AP_LTM_Telem/AP_LTM_Telem.cpp @@ -121,11 +121,13 @@ void AP_LTM_Telem::send_Sframe(void) const uint16_t amp = (uint16_t) roundf(current * 100.0f); // current sensor (expects value in hundredth of A) // airspeed in m/s if available and enabled - even if not used - otherwise send 0 - const AP_Airspeed *aspeed = AP::airspeed(); uint8_t airspeed = 0; // airspeed sensor (m/s) +#if AP_AIRSPEED_ENABLED + const AP_Airspeed *aspeed = AP::airspeed(); if (aspeed && aspeed->enabled()) { airspeed = (uint8_t) roundf(aspeed->get_airspeed()); } +#endif const uint8_t flightmode = AP_Notify::flags.flight_mode; // flight mode