mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 02:36:37 +08:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user