Skip to content

Commit 03141d4

Browse files
committed
espressif: i2c: initialize "has_lock"
Otherwise, a stack-constructed i2c instance might get some other value here.
1 parent 747b6e8 commit 03141d4

File tree

1 file changed

+1
-0
lines changed
  • ports/espressif/common-hal/busio

1 file changed

+1
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
8282
self->sda_pin = sda;
8383
self->scl_pin = scl;
8484
self->i2c_num = peripherals_i2c_get_free_num();
85+
self->has_lock = 0;
8586

8687
if (self->i2c_num == I2C_NUM_MAX) {
8788
mp_raise_ValueError(translate("All I2C peripherals are in use"));

0 commit comments

Comments
 (0)