Skip to content

Commit 4de6c7c

Browse files
authored
Merge pull request #5656 from dhalbert/rp2040-i2c-zero-write-bitbang-timeout
Use a longer clock stretching timeout for RP2040 zero-byte I2C writes
2 parents 36c1e8c + 80abd2d commit 4de6c7c

File tree

1 file changed

+4
-1
lines changed
  • ports/raspberrypi/common-hal/busio

1 file changed

+4
-1
lines changed

ports/raspberrypi/common-hal/busio/I2C.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,11 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
109109
// set up as GPIO by the bitbangio.I2C object.
110110
//
111111
// Sets pins to open drain, high, and input.
112+
//
113+
// Do not use the default supplied clock stretching timeout here.
114+
// It is too short for some devices. Use the busio timeout instead.
112115
shared_module_bitbangio_i2c_construct(&self->bitbangio_i2c, scl, sda,
113-
frequency, timeout);
116+
frequency, BUS_TIMEOUT_US);
114117

115118
self->baudrate = i2c_init(self->peripheral, frequency);
116119

0 commit comments

Comments
 (0)