diff --git a/libraries/SITL/SIM_GPS.h b/libraries/SITL/SIM_GPS.h index 1244f57338..dd2fa3d0f3 100644 --- a/libraries/SITL/SIM_GPS.h +++ b/libraries/SITL/SIM_GPS.h @@ -26,7 +26,7 @@ param set SERIAL5_PROTOCOL 5 #include #ifndef HAL_SIM_GPS_ENABLED -#define HAL_SIM_GPS_ENABLED (CONFIG_HAL_BOARD == HAL_BOARD_SITL && !defined(HAL_BUILD_AP_PERIPH)) +#define HAL_SIM_GPS_ENABLED (AP_SIM_ENABLED && !defined(HAL_BUILD_AP_PERIPH)) #endif #if HAL_SIM_GPS_ENABLED diff --git a/libraries/SITL/SITL.cpp b/libraries/SITL/SITL.cpp index 66b8f962a6..03899443df 100644 --- a/libraries/SITL/SITL.cpp +++ b/libraries/SITL/SITL.cpp @@ -19,11 +19,11 @@ #include "SITL.h" +#if AP_SIM_ENABLED + #include #include -#if CONFIG_HAL_BOARD == HAL_BOARD_SITL - #include #include #include @@ -659,4 +659,4 @@ SITL::SIM *sitl() }; -#endif // CONFIG_HAL_BOARD +#endif // AP_SIM_ENABLED diff --git a/libraries/SITL/SITL.h b/libraries/SITL/SITL.h index ec210a99d3..b3e95e0b87 100644 --- a/libraries/SITL/SITL.h +++ b/libraries/SITL/SITL.h @@ -2,7 +2,7 @@ #include -#if CONFIG_HAL_BOARD == HAL_BOARD_SITL +#if AP_SIM_ENABLED #include #include @@ -486,4 +486,4 @@ namespace AP { SITL::SIM *sitl(); }; -#endif // CONFIG_HAL_BOARD +#endif // AP_SIM_ENABLED