Quick Fix ESP8266 I2C Clock Stretch limit

- It seems the current implementation fails to set the clock stretch limit using functions from Wire library; It's set to 0 whatever the user wants it to be. This quick fix at least sets a default of 150ms to allow clock stretch to be used for devices that need it. It fixes support for Sensirion SCD30 and SGP30 which rely on clock stretching.. I'll dive deeper to solve the Wire provided functions.
This commit is contained in:
Theo Arends
2026-03-18 20:47:00 +01:00
parent 475881a0e0
commit 36c71bb2ea

View File

@@ -14,7 +14,7 @@ private:
unsigned char twi_sda = 0;
unsigned char twi_scl = 0;
unsigned char twi_addr = 0;
uint32_t twi_clockStretchLimit = 0;
uint32_t twi_clockStretchLimit = 150000;
// These are int-wide, even though they could all fit in a byte, to reduce code size and avoid any potential
// issues about RmW on packed bytes. The int-wide variations of asm instructions are smaller than the equivalent