From 2e6c13a9a17c88dcccc86b03f018690207f2e1e7 Mon Sep 17 00:00:00 2001 From: Nikita Date: Thu, 3 Jul 2025 10:53:50 +0200 Subject: [PATCH] Fixed sht35_init() by writing BREAK command before SOFT_RESET. Otherwise the sensor NACKs SOFT RESET if it is in periodic measurement mode. Therefore BREAK is needed before sending SOFT_RESET --- src/driver_sht35.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/driver_sht35.c b/src/driver_sht35.c index 0190daf..ae3ec63 100644 --- a/src/driver_sht35.c +++ b/src/driver_sht35.c @@ -222,6 +222,17 @@ uint8_t sht35_init(sht35_handle_t *handle) return 1; /* return error */ } + + command = SHT35_COMMAND_BREAK; /* set command */ + res = a_sht35_write(handle, command); /* write command */ + if (res != 0) /* check result */ + { + handle->debug_print("sht35: break command failed.\n"); /* write command failed */ + (void)handle->iic_deinit(); /* close iic */ + + return 1; /* return error */ + } + command = SHT35_COMMAND_SOFT_RESET; /* set command */ res = a_sht35_write(handle, command); /* write command */ if (res != 0) /* check result */