From 7898d6f107d1fa3ac2010d8c14152fc42a4f0fcb Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 12 Jan 2024 17:29:46 +1100 Subject: [PATCH] AP_ExternalAHRS: correct compilation when baro and compass externalahrs disabled --- libraries/AP_ExternalAHRS/AP_ExternalAHRS_InertialLabs.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/AP_ExternalAHRS/AP_ExternalAHRS_InertialLabs.cpp b/libraries/AP_ExternalAHRS/AP_ExternalAHRS_InertialLabs.cpp index ebf844f324..9019eaef46 100644 --- a/libraries/AP_ExternalAHRS/AP_ExternalAHRS_InertialLabs.cpp +++ b/libraries/AP_ExternalAHRS/AP_ExternalAHRS_InertialLabs.cpp @@ -466,13 +466,17 @@ bool AP_ExternalAHRS_InertialLabs::check_uart() last_gps_ms = now_ms; } } +#if AP_BARO_EXTERNALAHRS_ENABLED if (GOT_MSG(BARO_DATA) && GOT_MSG(TEMPERATURE)) { AP::baro().handle_external(baro_data); } +#endif + #if AP_COMPASS_EXTERNALAHRS_ENABLED if (GOT_MSG(MAG_DATA)) { AP::compass().handle_external(mag_data); } +#endif #if AP_AIRSPEED_EXTERNAL_ENABLED && (APM_BUILD_COPTER_OR_HELI || APM_BUILD_TYPE(APM_BUILD_ArduPlane)) // only on plane and copter as others do not link AP_Airspeed if (GOT_MSG(DIFFERENTIAL_PRESSURE) &&