diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2015-02-15 16:17:46 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2015-02-15 19:52:02 +0100 |
commit | 1e6bec6c77052f1eae7696c709dbc2edb503aa2b (patch) | |
tree | 63642a26c3dc2747120b63980ffcaad9cf87ecc4 | |
parent | 2e4c0c3156c72eb2f1ef99008a77fbce939a790e (diff) | |
download | px4-firmware-1e6bec6c77052f1eae7696c709dbc2edb503aa2b.tar.gz px4-firmware-1e6bec6c77052f1eae7696c709dbc2edb503aa2b.tar.bz2 px4-firmware-1e6bec6c77052f1eae7696c709dbc2edb503aa2b.zip |
HMC5883: Always report as internal sensor in SPI mode, since the sensor is fixed to the autopilot assembly.
-rw-r--r-- | src/drivers/hmc5883/hmc5883_spi.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/drivers/hmc5883/hmc5883_spi.cpp b/src/drivers/hmc5883/hmc5883_spi.cpp index aec990ca8..b88310539 100644 --- a/src/drivers/hmc5883/hmc5883_spi.cpp +++ b/src/drivers/hmc5883/hmc5883_spi.cpp @@ -138,15 +138,12 @@ HMC5883_SPI::ioctl(unsigned operation, unsigned &arg) switch (operation) { case MAGIOCGEXTERNAL: - -#ifdef PX4_SPI_BUS_EXT - if (_bus == PX4_SPI_BUS_EXT) { - return 1; - } else -#endif - { - return 0; - } + /* + * Even if this sensor is on the external SPI + * bus it is still internal to the autopilot + * assembly, so always return 0 for internal. + */ + return 0; case DEVIOCGDEVICEID: return CDev::ioctl(nullptr, operation, arg); |