sensors/bmi160: Fix a bug sensor_time is truncated
Build Documentation / build-html (push) Has been cancelled

Fix a bug that sensor_time resolution is lost by bit shift.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
This commit is contained in:
SPRESENSE
2025-07-09 09:35:48 +09:00
committed by Alin Jerpelea
parent be5c90716c
commit a20ac0fe7c
+4 -4
View File
@@ -145,12 +145,12 @@ static ssize_t bmi160_read(FAR struct file *filep, FAR char *buffer,
return 0;
}
/* Set sensor_time to the lower 24 bits of SENSORTIME. */
p->sensor_time = 0;
bmi160_getregs(priv, BMI160_DATA_8, (FAR uint8_t *)buffer, 15);
/* Adjust sensing time into 24 bit */
p->sensor_time >>= 8;
return len;
}