diff --git a/libraries/AP_RPM/RPM_SITL.cpp b/libraries/AP_RPM/RPM_SITL.cpp
index 7df2fd03ec..3b4269810a 100644
--- a/libraries/AP_RPM/RPM_SITL.cpp
+++ b/libraries/AP_RPM/RPM_SITL.cpp
@@ -13,14 +13,13 @@
along with this program. If not, see .
*/
-#include
-
-#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
#include "RPM_SITL.h"
-extern const AP_HAL::HAL& hal;
+#if AP_RPM_SIM_ENABLED
-/*
+#include
+
+/*
open the sensor in constructor
*/
AP_RPM_SITL::AP_RPM_SITL(AP_RPM &_ap_rpm, uint8_t _instance, AP_RPM::RPM_State &_state) :
@@ -46,4 +45,4 @@ void AP_RPM_SITL::update(void)
}
-#endif // CONFIG_HAL_BOARD
+#endif // AP_RPM_SIM_ENABLED
diff --git a/libraries/AP_RPM/RPM_SITL.h b/libraries/AP_RPM/RPM_SITL.h
index aff9b86f40..cff2511cf9 100644
--- a/libraries/AP_RPM/RPM_SITL.h
+++ b/libraries/AP_RPM/RPM_SITL.h
@@ -14,9 +14,10 @@
*/
#pragma once
-#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
-
#include "AP_RPM.h"
+
+#if AP_RPM_SIM_ENABLED
+
#include "RPM_Backend.h"
#include
@@ -33,4 +34,4 @@ private:
uint8_t instance;
};
-#endif // CONFIG_HAL_BOARD
+#endif // AP_RPM_SIM_ENABLED