mirror of
https://github.com/apache/nuttx.git
synced 2026-05-22 22:20:01 +08:00
sensors/bmi160: Fix a bug sensor_time is truncated
Build Documentation / build-html (push) Has been cancelled
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user