Merge pull request #5220 from tannewt/fix_esp_i2c_display
Allocate I2C mutex with IDF
This commit is contained in:
commit
df13bef3a1
|
@ -88,7 +88,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
self->xSemaphore = xSemaphoreCreateMutexStatic(&self->xSemaphoreBuffer);
|
self->xSemaphore = xSemaphoreCreateMutex();
|
||||||
if (self->xSemaphore == NULL) {
|
if (self->xSemaphore == NULL) {
|
||||||
mp_raise_RuntimeError(translate("Unable to create lock"));
|
mp_raise_RuntimeError(translate("Unable to create lock"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,6 @@ typedef struct {
|
||||||
const mcu_pin_obj_t *sda_pin;
|
const mcu_pin_obj_t *sda_pin;
|
||||||
i2c_port_t i2c_num;
|
i2c_port_t i2c_num;
|
||||||
SemaphoreHandle_t xSemaphore;
|
SemaphoreHandle_t xSemaphore;
|
||||||
StaticSemaphore_t xSemaphoreBuffer;
|
|
||||||
bool has_lock;
|
bool has_lock;
|
||||||
} busio_i2c_obj_t;
|
} busio_i2c_obj_t;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue