Skip to content

Commit a2acc86

Browse files
ubiedadanieldegrasse
authored andcommitted
fix: icm42688: fix: Override FSR settings when high-res is enabled
When IMU is set to stream with High-res mode, the FSR settings are fixed for ICM42688 at 16g and 2000dps. Unless this is enforced, the driver will provide incorrect scaling for readings coming through streaming when the current FS setting is any different than these. Signed-off-by: Luis Ubieda <[email protected]>
1 parent 87ce158 commit a2acc86

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/sensor/tdk/icm42688/icm42688_rtio_stream.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,10 @@ static void icm42688_fifo_count_cb(struct rtio *r, const struct rtio_sqe *sqe, v
111111
struct icm42688_fifo_data hdr = {
112112
.header = {
113113
.is_fifo = true,
114-
.gyro_fs = drv_data->cfg.gyro_fs,
115-
.accel_fs = drv_data->cfg.accel_fs,
114+
.gyro_fs = drv_data->cfg.fifo_hires ? ICM42688_DT_GYRO_FS_2000 :
115+
drv_data->cfg.gyro_fs,
116+
.accel_fs = drv_data->cfg.fifo_hires ? ICM42688_DT_ACCEL_FS_16 :
117+
drv_data->cfg.accel_fs,
116118
.timestamp = drv_data->timestamp,
117119
.axis_align[0] = drv_data->cfg.axis_align[0],
118120
.axis_align[1] = drv_data->cfg.axis_align[1],

0 commit comments

Comments
 (0)