diff --git a/libraries/AP_ExternalAHRS/AP_ExternalAHRS_LORD.cpp b/libraries/AP_ExternalAHRS/AP_ExternalAHRS_LORD.cpp index 2d390ff44b..eda7f91c4e 100644 --- a/libraries/AP_ExternalAHRS/AP_ExternalAHRS_LORD.cpp +++ b/libraries/AP_ExternalAHRS/AP_ExternalAHRS_LORD.cpp @@ -269,6 +269,7 @@ void AP_ExternalAHRS_LORD::post_imu() const AP::compass().handle_external(mag); } +#if AP_BARO_EXTERNALAHRS_ENABLED { const AP_ExternalAHRS::baro_data_message_t baro { instance: 0, @@ -278,6 +279,7 @@ void AP_ExternalAHRS_LORD::post_imu() const }; AP::baro().handle_external(baro); } +#endif } // Collects data from a gnss packet into `gnss_data` diff --git a/libraries/AP_ExternalAHRS/AP_ExternalAHRS_VectorNav.cpp b/libraries/AP_ExternalAHRS/AP_ExternalAHRS_VectorNav.cpp index da14f5be54..72b64a160b 100644 --- a/libraries/AP_ExternalAHRS/AP_ExternalAHRS_VectorNav.cpp +++ b/libraries/AP_ExternalAHRS/AP_ExternalAHRS_VectorNav.cpp @@ -244,7 +244,8 @@ void AP_ExternalAHRS_VectorNav::process_packet1(const uint8_t *b) Location::AltFrame::ABSOLUTE}; state.have_location = true; } - + +#if AP_BARO_EXTERNALAHRS_ENABLED { AP_ExternalAHRS::baro_data_message_t baro; baro.instance = 0; @@ -253,6 +254,7 @@ void AP_ExternalAHRS_VectorNav::process_packet1(const uint8_t *b) AP::baro().handle_external(baro); } +#endif { AP_ExternalAHRS::mag_data_message_t mag;