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
This commit is contained in:
David Sidrane 2017-01-13 10:57:43 -10:00 committed by Lorenz Meier
parent 084e714f62
commit 43c1237d00

View File

@ -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);