diff options
author | Timofey Titovets <nefelim4ag@gmail.com> | 2025-07-03 21:50:35 +0200 |
---|---|---|
committer | KevinOConnor <kevin@koconnor.net> | 2025-07-11 10:46:57 -0400 |
commit | 2585accfeb0e8291a0d428e8d3dfc72ff8f0cec7 (patch) | |
tree | 66aaace13f2f20baf2745e9f179637e7e21a7127 /klippy/extras/bus.py | |
parent | 37ddab223f54823d7252f87ea1b025a43031b878 (diff) | |
download | kutter-2585accfeb0e8291a0d428e8d3dfc72ff8f0cec7.tar.gz kutter-2585accfeb0e8291a0d428e8d3dfc72ff8f0cec7.tar.xz kutter-2585accfeb0e8291a0d428e8d3dfc72ff8f0cec7.zip |
sht3x: reads should be retried with at least 0.5s pause
SHT3x would return a read NACK on host retries.
When the MCU receives the I2C CMD, it reads out data.
SHT3x clears the data buffer.
The MCU fails to deliver a response to the host.
The host retries, the device returns NACK,
then the MCU goes into the shutdown state.
Make sure there is at least 0.5s between retries.
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Diffstat (limited to 'klippy/extras/bus.py')
-rw-r--r-- | klippy/extras/bus.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/klippy/extras/bus.py b/klippy/extras/bus.py index c07ec826..4121c1c8 100644 --- a/klippy/extras/bus.py +++ b/klippy/extras/bus.py @@ -217,8 +217,8 @@ class MCU_I2C: def i2c_write_wait_ack(self, data, minclock=0, reqclock=0): self.i2c_write_cmd.send_wait_ack([self.oid, data], minclock=minclock, reqclock=reqclock) - def i2c_read(self, write, read_len): - return self.i2c_read_cmd.send([self.oid, write, read_len]) + def i2c_read(self, write, read_len, retry=True): + return self.i2c_read_cmd.send([self.oid, write, read_len], retry) def MCU_I2C_from_config(config, default_addr=None, default_speed=100000): # Load bus parameters |