mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-08 10:50:19 +08:00
hmc5883: fixed driver startup when trying both buses
This commit is contained in:
committed by
Lorenz Meier
parent
5e62ae7a9e
commit
dfee93f3b1
@@ -1325,11 +1325,11 @@ start(enum Rotation rotation)
|
||||
exit(0);
|
||||
|
||||
fail:
|
||||
if (g_dev_int != nullptr) {
|
||||
if (g_dev_int != nullptr && (bus == -1 || bus == PX4_I2C_BUS_ONBOARD)) {
|
||||
delete g_dev_int;
|
||||
g_dev_int = nullptr;
|
||||
}
|
||||
if (g_dev_ext != nullptr) {
|
||||
if (g_dev_ext != nullptr && (bus == -1 || bus == PX4_I2C_BUS_EXPANSION)) {
|
||||
delete g_dev_ext;
|
||||
g_dev_ext = nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user