From fd31091fdbe916c518319e7456daed10735be6c3 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Fri, 8 Mar 2019 10:22:25 -0800 Subject: [PATCH] bmm150:Restored lost internal i2C --- boards/px4/fmu-v4/init/rc.board_sensors | 2 +- src/drivers/magnetometer/bmm150/bmm150.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/boards/px4/fmu-v4/init/rc.board_sensors b/boards/px4/fmu-v4/init/rc.board_sensors index 6b59c41169..5e4e816f0d 100644 --- a/boards/px4/fmu-v4/init/rc.board_sensors +++ b/boards/px4/fmu-v4/init/rc.board_sensors @@ -19,7 +19,7 @@ ist8310 start bmp280 -I start # expansion i2c used for BMM150 rotated by 90deg -bmm150 -R 2 start +bmm150 -X -R 2 start # For Teal One airframe if param compare SYS_AUTOSTART 4250 diff --git a/src/drivers/magnetometer/bmm150/bmm150.cpp b/src/drivers/magnetometer/bmm150/bmm150.cpp index cc7d5fe2ca..21c0fb90e1 100644 --- a/src/drivers/magnetometer/bmm150/bmm150.cpp +++ b/src/drivers/magnetometer/bmm150/bmm150.cpp @@ -86,8 +86,12 @@ void start(bool external_bus, enum Rotation rotation) #endif } else { +#if defined(PX4_I2C_BUS_ONBOARD) + *g_dev_ptr = new BMM150(PX4_I2C_BUS_ONBOARD, path, rotation); +#else PX4_ERR("Internal I2C not available"); exit(0); +#endif } if (*g_dev_ptr == nullptr) {