icm42688p: fix comment about gyro and accel bits

This really confused me.

Signed-off-by: Julian Oes <julian@oes.ch>
This commit is contained in:
Julian Oes
2023-02-20 14:39:31 +13:00
committed by Daniel Agar
parent 2008a447c3
commit 9ec6a4b1d7
@@ -642,7 +642,7 @@ void ICM42688P::ProcessAccel(const hrt_abstime &timestamp_sample, const FIFO::DA
accel.timestamp_sample = timestamp_sample;
accel.samples = 0;
// 18-bits of accelerometer data
// 18-bits of accelerometer data, sent as 20-bits, 2 least significant bits always 0
bool scale_20bit = false;
// first pass
@@ -738,7 +738,7 @@ void ICM42688P::ProcessGyro(const hrt_abstime &timestamp_sample, const FIFO::DAT
gyro.timestamp_sample = timestamp_sample;
gyro.samples = 0;
// 20-bits of gyroscope data
// 19-bits of gyroscope data sent as 20-bits, LSB bit is 0
bool scale_20bit = false;
// first pass
@@ -775,6 +775,7 @@ void ICM42688P::ProcessGyro(const hrt_abstime &timestamp_sample, const FIFO::DAT
scale_20bit = true;
}
// shift by 1 (least significant bit is always 0)
gyro.x[gyro.samples] = gyro_x / 2;
gyro.y[gyro.samples] = gyro_y / 2;
gyro.z[gyro.samples] = gyro_z / 2;