mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-10 18:08:30 -04:00
AP_InertialSensor: fix copying wrong number of bytes
We should copy only the bytes we read, not the maximum number.
This commit is contained in:
parent
209e1924a5
commit
f3f54157be
@ -354,7 +354,7 @@ void AP_MPU6000_BusDriver_I2C::read_burst(uint8_t *samples,
|
||||
return;
|
||||
}
|
||||
|
||||
memcpy(samples, _rx, MPU6000_SAMPLE_SIZE * MPU6000_MAX_FIFO_SAMPLES);
|
||||
memcpy(samples, _rx, n_samples * MPU6000_SAMPLE_SIZE);
|
||||
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user