AP_InertialSensor: allow enabling of only some ExternalAHRS sensors

This commit is contained in:
Andrew Tridgell 2023-01-24 15:40:17 +11:00
parent 07d56d83e7
commit 18f0fc50d5

View File

@ -1072,7 +1072,7 @@ AP_InertialSensor::detect_backends(void)
#if HAL_EXTERNAL_AHRS_ENABLED #if HAL_EXTERNAL_AHRS_ENABLED
// if enabled, make the first IMU the external AHRS // if enabled, make the first IMU the external AHRS
const int8_t serial_port = AP::externalAHRS().get_port(); const int8_t serial_port = AP::externalAHRS().get_port(AP_ExternalAHRS::AvailableSensor::IMU);
if (serial_port >= 0) { if (serial_port >= 0) {
ADD_BACKEND(new AP_InertialSensor_ExternalAHRS(*this, serial_port)); ADD_BACKEND(new AP_InertialSensor_ExternalAHRS(*this, serial_port));
} }