mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
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:
parent
084e714f62
commit
43c1237d00
@ -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);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user