Browse Source

bmm150 fix I2C bus define (#8261)

According to the board_config.h shown. bmm150 only on the external i2c bus
sbg
makekam 7 years ago committed by Daniel Agar
parent
commit
e9e663432b
  1. 5
      src/drivers/bmm150/bmm150.cpp

5
src/drivers/bmm150/bmm150.cpp

@ -77,7 +77,7 @@ void start(bool external_bus, enum Rotation rotation) @@ -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) @@ -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) {

Loading…
Cancel
Save