AP_Compass: allow enabling of only some ExternalAHRS sensors

This commit is contained in:
Andrew Tridgell 2023-01-24 15:40:17 +11:00
parent cf2b04d082
commit 07d56d83e7
1 changed files with 1 additions and 1 deletions

View File

@ -1268,7 +1268,7 @@ void Compass::_probe_external_i2c_compasses(void)
void Compass::_detect_backends(void)
{
#if AP_COMPASS_EXTERNALAHRS_ENABLED
const int8_t serial_port = AP::externalAHRS().get_port();
const int8_t serial_port = AP::externalAHRS().get_port(AP_ExternalAHRS::AvailableSensor::COMPASS);
if (serial_port >= 0) {
ADD_BACKEND(DRIVER_SERIAL, new AP_Compass_ExternalAHRS(serial_port));
}