Merge pull request #2111 from tannewt/fix_ssd1306_hang

Fix I2CDisplay bus_free to not grab lock
crypto-aes
Dan Halbert 3 years ago committed by GitHub
commit e92b5f7e3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -90,7 +90,7 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self,
self->core.send(self->core.bus, DISPLAY_COMMAND, CHIP_SELECT_TOGGLE_EVERY_BYTE, cmd, 1);
self->core.send(self->core.bus, DISPLAY_DATA, CHIP_SELECT_UNTOUCHED, data, data_size);
}
self->core.end_transaction(self->core.bus);
displayio_display_core_end_transaction(&self->core);
uint16_t delay_length_ms = 10;
if (delay) {
data_size++;

@ -91,11 +91,13 @@ bool common_hal_displayio_i2cdisplay_bus_free(mp_obj_t obj) {
if (!common_hal_busio_i2c_try_lock(self->bus)) {
return false;
}
common_hal_busio_i2c_unlock(self->bus);
return true;
}
bool common_hal_displayio_i2cdisplay_begin_transaction(mp_obj_t obj) {
return common_hal_displayio_i2cdisplay_bus_free(obj);
displayio_i2cdisplay_obj_t* self = MP_OBJ_TO_PTR(obj);
return !common_hal_busio_i2c_try_lock(self->bus);
}
void common_hal_displayio_i2cdisplay_send(mp_obj_t obj, display_byte_type_t data_type, display_chip_select_behavior_t chip_select, uint8_t *data, uint32_t data_length) {

Loading…
Cancel
Save