From 7ad9609fb70d5b40dec86b5a4a16837bd15610ee Mon Sep 17 00:00:00 2001
From: Peter Barker <pbarker@barker.dropbear.id.au>
Date: Sat, 30 Oct 2021 11:38:13 +1100
Subject: [PATCH] AP_AHRS: split AP_HAL_SITL and HAL_SIM_ENABLED

---
 libraries/AP_AHRS/AP_AHRS.cpp | 2 +-
 libraries/AP_AHRS/AP_AHRS.h   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libraries/AP_AHRS/AP_AHRS.cpp b/libraries/AP_AHRS/AP_AHRS.cpp
index 9816e11b3c..a37ac73bbd 100644
--- a/libraries/AP_AHRS/AP_AHRS.cpp
+++ b/libraries/AP_AHRS/AP_AHRS.cpp
@@ -3141,7 +3141,7 @@ void AP_AHRS::Log_Write()
     Write_AHRS2();
     Write_POS();
 
-#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
+#if AP_AHRS_SIM_ENABLED
     AP::sitl()->Log_Write_SIMSTATE();
 #endif
 }
diff --git a/libraries/AP_AHRS/AP_AHRS.h b/libraries/AP_AHRS/AP_AHRS.h
index c2da9f2185..a58ab57df7 100644
--- a/libraries/AP_AHRS/AP_AHRS.h
+++ b/libraries/AP_AHRS/AP_AHRS.h
@@ -33,7 +33,7 @@
 #endif
 
 #ifndef AP_AHRS_SIM_ENABLED
-#define AP_AHRS_SIM_ENABLED (CONFIG_HAL_BOARD == HAL_BOARD_SITL)
+#define AP_AHRS_SIM_ENABLED AP_SIM_ENABLED
 #endif
 
 #if AP_AHRS_SIM_ENABLED