forked from Archive/PX4-Autopilot
mpu9250: fix mag publishing garbage on IMU failure (SPI only)
The Pixhawk cube as an internal mag on SPI. If there was a bad register read (e.g. on an IMU failure), _register_wait was non-zero and there was no transfer but _mag still published mpu_report.mag.
This commit is contained in:
parent
33fe69a3e8
commit
c3ac1497c0
|
@ -1058,7 +1058,9 @@ MPU9250::measure()
|
|||
if (_mag->is_passthrough()) {
|
||||
# endif
|
||||
|
||||
_mag->_measure(mpu_report.mag);
|
||||
if (_register_wait == 0) {
|
||||
_mag->_measure(mpu_report.mag);
|
||||
}
|
||||
|
||||
# ifdef USE_I2C
|
||||
|
||||
|
|
Loading…
Reference in New Issue