Skip to content

Commit be5c907

Browse files
SPRESENSEjerpelea
authored andcommitted
sensors/bmi270: Fix a bug sensor_time is truncated
Fix a bug that sensor_time resolution is lost by bit shift. Signed-off-by: SPRESENSE <[email protected]>
1 parent 6ae3cc9 commit be5c907

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/sensors/bmi270.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,11 @@ static ssize_t bmi270_read(FAR struct file *filep, FAR char *buffer,
141141
return 0;
142142
}
143143

144-
bmi270_getregs(priv, BMI270_DATA_8, (FAR uint8_t *)p, 15);
144+
/* Set sensor_time to the lower 24 bits of SENSORTIME. */
145145

146-
/* Adjust sensing time into 24 bit */
146+
p->sensor_time = 0;
147147

148-
p->sensor_time >>= 8;
148+
bmi270_getregs(priv, BMI270_DATA_8, (FAR uint8_t *)p, 15);
149149

150150
return len;
151151
}

0 commit comments

Comments
 (0)