mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-05 12:51:36 +08:00
MPU6K: Make stop routine safe to call from any location in the startup code
This commit is contained in:
@@ -1696,8 +1696,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)
|
||||
|
||||
Reference in New Issue
Block a user