We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 61992cc + 71ba035 commit 77b9880Copy full SHA for 77b9880
ports/espressif/common-hal/busio/I2C.c
@@ -6,6 +6,7 @@
6
7
#include "shared-bindings/busio/I2C.h"
8
#include "py/mperrno.h"
9
+#include "py/mphal.h"
10
#include "py/runtime.h"
11
12
#include "components/driver/i2c/include/driver/i2c.h"
@@ -134,6 +135,12 @@ void common_hal_busio_i2c_deinit(busio_i2c_obj_t *self) {
134
135
136
bool common_hal_busio_i2c_probe(busio_i2c_obj_t *self, uint8_t addr) {
137
esp_err_t result = i2c_master_probe(self->handle, addr, 10);
138
+
139
+ #if defined(CONFIG_IDF_TARGET_ESP32S2)
140
+ // ESP32-S2 gives spurious results when probe is called multiple times in succession without this delay.
141
+ mp_hal_delay_ms(1);
142
+ #endif
143
144
return result == ESP_OK;
145
}
146
0 commit comments