From 855f4fe2d24e463e0ba504ca2fa6391b076903e2 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 28 Sep 2022 11:38:10 +1000 Subject: [PATCH] AP_RPM: correct SITL backend compilation if RPM disabled in SITL --- libraries/AP_RPM/RPM_SITL.cpp | 11 +++++------ libraries/AP_RPM/RPM_SITL.h | 7 ++++--- 2 files changed, 9 insertions(+), 9 deletions(-) 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