Skip to content

Commit

Permalink
AP_ExternalAHRS: Allow InertialLabs to be used as build option properly
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
joshanne committed Aug 12, 2024
1 parent c3b6127 commit 6c2f658
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion libraries/AP_ExternalAHRS/AP_ExternalAHRS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_ExternalAHRS/AP_ExternalAHRS.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class AP_ExternalAHRS {
#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
Expand Down
4 changes: 2 additions & 2 deletions libraries/AP_ExternalAHRS/AP_ExternalAHRS_InertialLabs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <AP_Math/AP_Math.h>
Expand Down Expand Up @@ -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

4 changes: 2 additions & 2 deletions libraries/AP_ExternalAHRS/AP_ExternalAHRS_InertialLabs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -228,5 +228,5 @@ class AP_ExternalAHRS_InertialLabs : public AP_ExternalAHRS_backend {
uint32_t last_gps_ms;
};

#endif // AP_EXTERNAL_AHRS_INERTIAL_LABS_ENABLED
#endif // AP_EXTERNAL_AHRS_INERTIALLABS_ENABLED

4 changes: 2 additions & 2 deletions libraries/AP_ExternalAHRS/AP_ExternalAHRS_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 6c2f658

Please sign in to comment.