diff --git a/ports/espressif/common-hal/busio/I2C.c b/ports/espressif/common-hal/busio/I2C.c index 88dffb5d2c82..828d8b1427fb 100644 --- a/ports/espressif/common-hal/busio/I2C.c +++ b/ports/espressif/common-hal/busio/I2C.c @@ -6,6 +6,7 @@ #include "shared-bindings/busio/I2C.h" #include "py/mperrno.h" +#include "py/mphal.h" #include "py/runtime.h" #include "components/driver/i2c/include/driver/i2c.h" @@ -134,6 +135,8 @@ void common_hal_busio_i2c_deinit(busio_i2c_obj_t *self) { bool common_hal_busio_i2c_probe(busio_i2c_obj_t *self, uint8_t addr) { esp_err_t result = i2c_master_probe(self->handle, addr, 10); + // ESP32-S2 gives spurious results when probe is called multiple times in succession without this delay. + mp_hal_delay_ms(1); return result == ESP_OK; }