mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-25 08:36:08 +08:00
hmc5883: Fix for Issue1858 detection of MAG on Int/Ext I2C Bus.
This commit is contained in:
committed by
Lorenz Meier
parent
0801dbda38
commit
215e8e2466
@@ -113,11 +113,17 @@ HMC5883_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;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
return 1;
|
||||
#endif
|
||||
|
||||
case DEVIOCGDEVICEID:
|
||||
return CDev::ioctl(nullptr, operation, arg);
|
||||
|
||||
Reference in New Issue
Block a user