From 39f7d7a3ad398398ac5b4ca30a95ab9e4358c793 Mon Sep 17 00:00:00 2001 From: James O'Shannessy <12959316+joshanne@users.noreply.github.com> Date: Tue, 13 Aug 2024 09:15:31 +1000 Subject: [PATCH] AP_ExternalAHRS: Allow InertialLabs to be used as build option properly build_options cannot autodetect InertialLabs since the feature is extracted as AP_EXTERNAL_AHRS_INERTIALLABS_ENABLED (without the underscore). This allows you to define in/out InertialLabs properly. --- libraries/AP_ExternalAHRS/AP_ExternalAHRS.cpp | 2 +- libraries/AP_ExternalAHRS/AP_ExternalAHRS.h | 2 +- libraries/AP_ExternalAHRS/AP_ExternalAHRS_InertialLabs.cpp | 4 ++-- libraries/AP_ExternalAHRS/AP_ExternalAHRS_InertialLabs.h | 4 ++-- libraries/AP_ExternalAHRS/AP_ExternalAHRS_config.h | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libraries/AP_ExternalAHRS/AP_ExternalAHRS.cpp b/libraries/AP_ExternalAHRS/AP_ExternalAHRS.cpp index e113eba81d..229ca00dea 100644 --- a/libraries/AP_ExternalAHRS/AP_ExternalAHRS.cpp +++ b/libraries/AP_ExternalAHRS/AP_ExternalAHRS.cpp @@ -124,7 +124,7 @@ void AP_ExternalAHRS::init(void) return; #endif -#if AP_EXTERNAL_AHRS_INERTIAL_LABS_ENABLED +#if AP_EXTERNAL_AHRS_INERTIALLABS_ENABLED case DevType::InertialLabs: backend = NEW_NOTHROW AP_ExternalAHRS_InertialLabs(this, state); return; diff --git a/libraries/AP_ExternalAHRS/AP_ExternalAHRS.h b/libraries/AP_ExternalAHRS/AP_ExternalAHRS.h index 2d01f28c28..a08c282291 100644 --- a/libraries/AP_ExternalAHRS/AP_ExternalAHRS.h +++ b/libraries/AP_ExternalAHRS/AP_ExternalAHRS.h @@ -49,7 +49,7 @@ public: #if AP_EXTERNAL_AHRS_MICROSTRAIN5_ENABLED MicroStrain5 = 2, #endif -#if AP_EXTERNAL_AHRS_INERTIAL_LABS_ENABLED +#if AP_EXTERNAL_AHRS_INERTIALLABS_ENABLED InertialLabs = 5, #endif // 3 reserved for AdNav diff --git a/libraries/AP_ExternalAHRS/AP_ExternalAHRS_InertialLabs.cpp b/libraries/AP_ExternalAHRS/AP_ExternalAHRS_InertialLabs.cpp index 43e858a740..129c11616a 100644 --- a/libraries/AP_ExternalAHRS/AP_ExternalAHRS_InertialLabs.cpp +++ b/libraries/AP_ExternalAHRS/AP_ExternalAHRS_InertialLabs.cpp @@ -18,7 +18,7 @@ #include "AP_ExternalAHRS_config.h" -#if AP_EXTERNAL_AHRS_INERTIAL_LABS_ENABLED +#if AP_EXTERNAL_AHRS_INERTIALLABS_ENABLED #include "AP_ExternalAHRS_InertialLabs.h" #include @@ -692,5 +692,5 @@ void AP_ExternalAHRS_InertialLabs::send_status_report(GCS_MAVLINK &link) const mag_var, 0, 0); } -#endif // AP_EXTERNAL_AHRS_INERTIAL_LABS_ENABLED +#endif // AP_EXTERNAL_AHRS_INERTIALLABS_ENABLED diff --git a/libraries/AP_ExternalAHRS/AP_ExternalAHRS_InertialLabs.h b/libraries/AP_ExternalAHRS/AP_ExternalAHRS_InertialLabs.h index 9de2c9526e..639d39e2d5 100644 --- a/libraries/AP_ExternalAHRS/AP_ExternalAHRS_InertialLabs.h +++ b/libraries/AP_ExternalAHRS/AP_ExternalAHRS_InertialLabs.h @@ -20,7 +20,7 @@ #include "AP_ExternalAHRS_config.h" -#if AP_EXTERNAL_AHRS_INERTIAL_LABS_ENABLED +#if AP_EXTERNAL_AHRS_INERTIALLABS_ENABLED #include "AP_ExternalAHRS_backend.h" @@ -228,5 +228,5 @@ private: uint32_t last_gps_ms; }; -#endif // AP_EXTERNAL_AHRS_INERTIAL_LABS_ENABLED +#endif // AP_EXTERNAL_AHRS_INERTIALLABS_ENABLED diff --git a/libraries/AP_ExternalAHRS/AP_ExternalAHRS_config.h b/libraries/AP_ExternalAHRS/AP_ExternalAHRS_config.h index 75e8e52280..650f605b0a 100644 --- a/libraries/AP_ExternalAHRS/AP_ExternalAHRS_config.h +++ b/libraries/AP_ExternalAHRS/AP_ExternalAHRS_config.h @@ -26,6 +26,6 @@ #define AP_EXTERNAL_AHRS_VECTORNAV_ENABLED AP_EXTERNAL_AHRS_BACKEND_DEFAULT_ENABLED #endif -#ifndef AP_EXTERNAL_AHRS_INERTIAL_LABS_ENABLED -#define AP_EXTERNAL_AHRS_INERTIAL_LABS_ENABLED AP_EXTERNAL_AHRS_BACKEND_DEFAULT_ENABLED +#ifndef AP_EXTERNAL_AHRS_INERTIALLABS_ENABLED +#define AP_EXTERNAL_AHRS_INERTIALLABS_ENABLED AP_EXTERNAL_AHRS_BACKEND_DEFAULT_ENABLED #endif