From 147b5762f0feba44f96018015dbcebb2e3aa039b Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Wed, 1 May 2024 18:51:29 +0200 Subject: [PATCH] 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) {