mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-23 22:58:10 +08:00
bmm150 fix I2C bus define (#8261)
According to the board_config.h shown. bmm150 only on the external i2c bus
This commit is contained in:
@@ -77,7 +77,7 @@ void start(bool external_bus, enum Rotation rotation)
|
||||
|
||||
/* create the driver */
|
||||
if (external_bus) {
|
||||
#if defined(PX4_SPI_BUS_EXT) && defined(PX4_SPIDEV_EXT_BMI)
|
||||
#if defined(PX4_I2C_BUS_BMM150)
|
||||
*g_dev_ptr = new BMM150(PX4_I2C_BUS_BMM150, path, external_bus, rotation);
|
||||
#else
|
||||
PX4_ERR("External I2C not available");
|
||||
@@ -85,7 +85,8 @@ void start(bool external_bus, enum Rotation rotation)
|
||||
#endif
|
||||
|
||||
} else {
|
||||
*g_dev_ptr = new BMM150(PX4_I2C_BUS_BMM150, path, external_bus, rotation);
|
||||
PX4_ERR("Internal I2C not available");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if (*g_dev_ptr == nullptr) {
|
||||
|
||||
Reference in New Issue
Block a user