From 32df9cfa94c7b55f318c233878ae57865579b7d2 Mon Sep 17 00:00:00 2001
From: Pulak Gautam <pulak.gautam@gmail.com>
Date: Sun, 3 Mar 2024 18:26:08 +0530
Subject: [PATCH] AP_ExternalAHRS: added missing #if AHRS logging

---
 libraries/AP_ExternalAHRS/AP_ExternalAHRS.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libraries/AP_ExternalAHRS/AP_ExternalAHRS.cpp b/libraries/AP_ExternalAHRS/AP_ExternalAHRS.cpp
index cbcc394fb0..dc3ff2a34b 100644
--- a/libraries/AP_ExternalAHRS/AP_ExternalAHRS.cpp
+++ b/libraries/AP_ExternalAHRS/AP_ExternalAHRS.cpp
@@ -301,6 +301,7 @@ void AP_ExternalAHRS::update(void)
             state.have_origin = true;
         }
     }
+#if HAL_LOGGING_ENABLED
     const uint32_t now_ms = AP_HAL::millis();
     if (log_rate.get() > 0 && now_ms - last_log_ms >= uint32_t(1000U/log_rate.get())) {
         last_log_ms = now_ms;
@@ -334,6 +335,7 @@ void AP_ExternalAHRS::update(void)
                                     state.location.lat, state.location.lng, state.location.alt*0.01,
                                     filterStatus.value);
     }
+#endif  // HAL_LOGGING_ENABLED
 }
 
 // Get model/type name