This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit be5c90716ccd25e336bcc6d7f0a3983b858ad802
Author: SPRESENSE <41312067+sprese...@users.noreply.github.com>
AuthorDate: Wed Jul 9 09:35:48 2025 +0900

    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 <41312067+sprese...@users.noreply.github.com>
---
 drivers/sensors/bmi270.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/sensors/bmi270.c b/drivers/sensors/bmi270.c
index d0e2ae206f2..f6c68c3a8c5 100644
--- a/drivers/sensors/bmi270.c
+++ b/drivers/sensors/bmi270.c
@@ -141,11 +141,11 @@ static ssize_t bmi270_read(FAR struct file *filep, FAR 
char *buffer,
       return 0;
     }
 
-  bmi270_getregs(priv, BMI270_DATA_8, (FAR uint8_t *)p, 15);
+  /* Set sensor_time to the lower 24 bits of SENSORTIME. */
 
-  /* Adjust sensing time into 24 bit */
+  p->sensor_time = 0;
 
-  p->sensor_time >>= 8;
+  bmi270_getregs(priv, BMI270_DATA_8, (FAR uint8_t *)p, 15);
 
   return len;
 }

Reply via email to