AP_ExternalAHRS: correct compilation if AP_Baro_ExternalAHRS isn't available

This commit is contained in:
Peter Barker 2022-05-24 16:33:48 +10:00 committed by Andrew Tridgell
parent b99c4b3a89
commit e9426b2ff3
2 changed files with 5 additions and 1 deletions

View File

@ -269,6 +269,7 @@ void AP_ExternalAHRS_LORD::post_imu() const
AP::compass().handle_external(mag); AP::compass().handle_external(mag);
} }
#if AP_BARO_EXTERNALAHRS_ENABLED
{ {
const AP_ExternalAHRS::baro_data_message_t baro { const AP_ExternalAHRS::baro_data_message_t baro {
instance: 0, instance: 0,
@ -278,6 +279,7 @@ void AP_ExternalAHRS_LORD::post_imu() const
}; };
AP::baro().handle_external(baro); AP::baro().handle_external(baro);
} }
#endif
} }
// Collects data from a gnss packet into `gnss_data` // Collects data from a gnss packet into `gnss_data`

View File

@ -244,7 +244,8 @@ void AP_ExternalAHRS_VectorNav::process_packet1(const uint8_t *b)
Location::AltFrame::ABSOLUTE}; Location::AltFrame::ABSOLUTE};
state.have_location = true; state.have_location = true;
} }
#if AP_BARO_EXTERNALAHRS_ENABLED
{ {
AP_ExternalAHRS::baro_data_message_t baro; AP_ExternalAHRS::baro_data_message_t baro;
baro.instance = 0; baro.instance = 0;
@ -253,6 +254,7 @@ void AP_ExternalAHRS_VectorNav::process_packet1(const uint8_t *b)
AP::baro().handle_external(baro); AP::baro().handle_external(baro);
} }
#endif
{ {
AP_ExternalAHRS::mag_data_message_t mag; AP_ExternalAHRS::mag_data_message_t mag;