AP_LTM_Telem: add define AP_AIRSPEED_ENABLED

This commit is contained in:
Josh Henderson 2021-11-01 04:15:51 -04:00 committed by Andrew Tridgell
parent 1aacd7ba02
commit 65d4b6377e
1 changed files with 3 additions and 1 deletions

View File

@ -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