We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0eddc63 commit 2b0e368Copy full SHA for 2b0e368
ports/espressif/common-hal/busio/I2C.c
@@ -132,6 +132,7 @@ void common_hal_busio_i2c_deinit(busio_i2c_obj_t *self) {
132
xSemaphoreGive(self->xSemaphore);
133
vSemaphoreDelete(self->xSemaphore);
134
self->xSemaphore = NULL;
135
+ self->has_lock = false;
136
137
common_hal_reset_pin(self->sda_pin);
138
common_hal_reset_pin(self->scl_pin);
@@ -165,6 +166,9 @@ bool common_hal_busio_i2c_has_lock(busio_i2c_obj_t *self) {
165
166
}
167
168
void common_hal_busio_i2c_unlock(busio_i2c_obj_t *self) {
169
+ if (common_hal_busio_i2c_deinited(self)) {
170
+ return;
171
+ }
172
173
self->has_lock = false;
174
0 commit comments