mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-04 01:41:36 +08:00
HMC5883 startup: Ensure sensor configuration is always performed
This commit is contained in:
@@ -1320,10 +1320,9 @@ start(int external_bus, enum Rotation rotation)
|
|||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
/* create the driver, attempt expansion bus first */
|
/* create the driver, attempt expansion bus first */
|
||||||
if (external_bus == HMC5883_BUS_ALL || external_bus == HMC5883_BUS_EXTERNAL) {
|
if (g_dev_ext != nullptr) {
|
||||||
if (g_dev_ext != nullptr) {
|
warnx("already started external");
|
||||||
errx(0, "already started external");
|
} else if (external_bus == HMC5883_BUS_ALL || external_bus == HMC5883_BUS_EXTERNAL) {
|
||||||
}
|
|
||||||
|
|
||||||
device::Device *interface = nullptr;
|
device::Device *interface = nullptr;
|
||||||
|
|
||||||
@@ -1364,10 +1363,9 @@ start(int external_bus, enum Rotation rotation)
|
|||||||
|
|
||||||
|
|
||||||
/* if this failed, attempt onboard sensor */
|
/* if this failed, attempt onboard sensor */
|
||||||
if (external_bus == HMC5883_BUS_ALL || external_bus == HMC5883_BUS_INTERNAL) {
|
if (g_dev_int != nullptr) {
|
||||||
if (g_dev_int != nullptr) {
|
warnx("already started internal");
|
||||||
errx(0, "already started internal");
|
} else if (external_bus == HMC5883_BUS_ALL || external_bus == HMC5883_BUS_INTERNAL) {
|
||||||
}
|
|
||||||
|
|
||||||
device::Device *interface = nullptr;
|
device::Device *interface = nullptr;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user