From df8801955db051cbf33f2b9b23cdc258cc819f78 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 23 Feb 2024 19:35:39 +1100 Subject: [PATCH] AP_Vehicle: don't create compass singleton if compass not enabled --- libraries/AP_Vehicle/AP_Vehicle.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/AP_Vehicle/AP_Vehicle.h b/libraries/AP_Vehicle/AP_Vehicle.h index 24b542d891..b2783f3cb5 100644 --- a/libraries/AP_Vehicle/AP_Vehicle.h +++ b/libraries/AP_Vehicle/AP_Vehicle.h @@ -317,7 +317,9 @@ protected: AP_GPS gps; #endif AP_Baro barometer; +#if AP_COMPASS_ENABLED Compass compass; +#endif #if AP_INERTIALSENSOR_ENABLED AP_InertialSensor ins; #endif