File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
ports/espressif/common-hal/busio Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,7 @@ void common_hal_busio_i2c_deinit(busio_i2c_obj_t *self) {
132132 xSemaphoreGive (self -> xSemaphore );
133133 vSemaphoreDelete (self -> xSemaphore );
134134 self -> xSemaphore = NULL ;
135+ self -> has_lock = false;
135136
136137 common_hal_reset_pin (self -> sda_pin );
137138 common_hal_reset_pin (self -> scl_pin );
@@ -165,6 +166,9 @@ bool common_hal_busio_i2c_has_lock(busio_i2c_obj_t *self) {
165166}
166167
167168void common_hal_busio_i2c_unlock (busio_i2c_obj_t * self ) {
169+ if (common_hal_busio_i2c_deinited (self )) {
170+ return ;
171+ }
168172 xSemaphoreGive (self -> xSemaphore );
169173 self -> has_lock = false;
170174}
Original file line number Diff line number Diff line change 44typer
55
66sh
7- click
7+ click < 8.2.0
88cpp-coveralls
99
1010requests
You can’t perform that action at this time.
0 commit comments