mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-06 19:00:27 +08:00
AP_Compass: add a probe method to AP_Compass_ExternalAHRS
this allows for the creation of the backend to fail gracefully without this the backend will still have a value of 0, and will still get updated, overwriting the data for one of the registered compasses
This commit is contained in:
committed by
Randy Mackay
parent
e2b737cfa3
commit
39a4032f70
@@ -1373,7 +1373,7 @@ void Compass::_detect_backends(void)
|
||||
#if AP_COMPASS_EXTERNALAHRS_ENABLED
|
||||
const int8_t serial_port = AP::externalAHRS().get_port(AP_ExternalAHRS::AvailableSensor::COMPASS);
|
||||
if (serial_port >= 0) {
|
||||
ADD_BACKEND(DRIVER_EXTERNALAHRS, NEW_NOTHROW AP_Compass_ExternalAHRS(serial_port));
|
||||
ADD_BACKEND(DRIVER_EXTERNALAHRS, AP_Compass_ExternalAHRS::probe(serial_port));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user