Browse Source

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
sbg
David Sidrane 8 years ago committed by Lorenz Meier
parent
commit
43c1237d00
  1. 7
      src/drivers/lis3mdl/lis3mdl_i2c.cpp

7
src/drivers/lis3mdl/lis3mdl_i2c.cpp

@ -112,9 +112,6 @@ LIS3MDL_I2C::ioctl(unsigned operation, unsigned &arg) @@ -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) @@ -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);

Loading…
Cancel
Save