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

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

commit 147b5762f0feba44f96018015dbcebb2e3aa039b
Author: raiden00pl <raide...@railab.me>
AuthorDate: Wed May 1 18:51:29 2024 +0200

    sensors/bh1749nuc_uorb.c: don't wait for VALID flag in fetch interface
    
    otherwise the sensor freezes when we read RBG and IR data one after another
---
 drivers/sensors/bh1749nuc_uorb.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/sensors/bh1749nuc_uorb.c b/drivers/sensors/bh1749nuc_uorb.c
index eb0872cc04..1e9b1e1ea1 100644
--- a/drivers/sensors/bh1749nuc_uorb.c
+++ b/drivers/sensors/bh1749nuc_uorb.c
@@ -221,10 +221,9 @@ static int bh1749nuc_fetch(FAR struct sensor_lowerhalf_s 
*lower,
       goto errout;
     }
 
-  /* Wait for data */
-
-  while (!(bh1749nuc_getreg8(dev, BH1749NUC_MODE_CONTROL2) &
-           BH1749NUC_MODE_CONTROL2_VALID));
+  /* Get data without wait for VALID flag - otherwise the sensor freezes
+   * when we read RBG and IR data one after another
+   */
 
   if (lower->type == SENSOR_TYPE_RGB)
     {

Reply via email to