From 43c1237d00a3be5022e0e8593400ac298e6e3d9c Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Fri, 13 Jan 2017 10:57:43 -1000 Subject: [PATCH] On lis3mdl use the bus setting to return internal/external Removed asssumtion that all HW other then PX4v1 has lis3mdl on an external i2c bus. Use the actual value of the bus the device was found and instanced on to return the result of MAGIOCGEXTERNAL ioctl --- src/drivers/lis3mdl/lis3mdl_i2c.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/drivers/lis3mdl/lis3mdl_i2c.cpp b/src/drivers/lis3mdl/lis3mdl_i2c.cpp index 7a2d6feb4b..5ef08d7159 100644 --- a/src/drivers/lis3mdl/lis3mdl_i2c.cpp +++ b/src/drivers/lis3mdl/lis3mdl_i2c.cpp @@ -112,9 +112,6 @@ LIS3MDL_I2C::ioctl(unsigned operation, unsigned &arg) switch (operation) { case MAGIOCGEXTERNAL: -// On PX4v1 the MAG can be on an internal I2C -// On everything else its always external -#ifdef CONFIG_ARCH_BOARD_PX4FMU_V1 if (_bus == PX4_I2C_BUS_EXPANSION) { return 1; @@ -122,10 +119,6 @@ LIS3MDL_I2C::ioctl(unsigned operation, unsigned &arg) return 0; } -#else - return 1; -#endif - case DEVIOCGDEVICEID: return CDev::ioctl(nullptr, operation, arg);