From 99ab50241dcaca2c344322c69fe50f4b4cd645f1 Mon Sep 17 00:00:00 2001 From: MRusinov Date: Sun, 4 Feb 2024 09:21:25 +0400 Subject: [PATCH] =?UTF-8?q?SHT4x=20often=20gives=20"i2cdev:=20Could=20not?= =?UTF-8?q?=20read=20from=20device=20[0x44=20at=200]"=20error=E2=80=A6=20?= =?UTF-8?q?=E2=80=A6=20on=20measurement=20#598=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/sht4x/sht4x.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/sht4x/sht4x.c b/components/sht4x/sht4x.c index 2ff0e41d..77329695 100644 --- a/components/sht4x/sht4x.c +++ b/components/sht4x/sht4x.c @@ -174,8 +174,7 @@ static esp_err_t exec_cmd(sht4x_t *dev, uint8_t cmd, size_t delay_ticks, sht4x_r { I2C_DEV_TAKE_MUTEX(&dev->i2c_dev); I2C_DEV_CHECK(&dev->i2c_dev, send_cmd_nolock(dev, cmd)); - if (delay_ticks) - vTaskDelay(delay_ticks); + vTaskDelay(delay_ticks + 1); I2C_DEV_CHECK(&dev->i2c_dev, read_res_nolock(dev, res)); I2C_DEV_GIVE_MUTEX(&dev->i2c_dev);