forked from Archive/PX4-Autopilot
MPU6K: Make stop routine safe to call from any location in the startup code
This commit is contained in:
parent
489ee58773
commit
fcc85f79d5
|
@ -1709,8 +1709,13 @@ MPU6000::stop()
|
|||
memset(_last_accel, 0, sizeof(_last_accel));
|
||||
|
||||
/* discard unread data in the buffers */
|
||||
_accel_reports->flush();
|
||||
_gyro_reports->flush();
|
||||
if (_accel_reports != nullptr) {
|
||||
_accel_reports->flush();
|
||||
}
|
||||
|
||||
if (_gyro_reports != nullptr) {
|
||||
_gyro_reports->flush();
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(USE_I2C)
|
||||
|
|
Loading…
Reference in New Issue