Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion locale/circuitpython.pot
Original file line number Diff line number Diff line change
Expand Up @@ -1557,7 +1557,7 @@ msgstr ""
msgid "Number of data_pins must be 8 or 16, not %d"
msgstr ""

#: shared-bindings/util.c
#: shared-bindings/util.c shared-module/displayio/FourWire.c
msgid ""
"Object has been deinitialized and can no longer be used. Create a new object."
msgstr ""
Expand Down
8 changes: 6 additions & 2 deletions shared-module/displayio/FourWire.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void common_hal_displayio_fourwire_construct(displayio_fourwire_obj_t *self,
}

void common_hal_displayio_fourwire_deinit(displayio_fourwire_obj_t *self) {
if (self->bus == &self->inline_bus) {
if (!(common_hal_busio_spi_deinited(self->bus)) && (self->bus == &self->inline_bus)) {
common_hal_busio_spi_deinit(self->bus);
}

Expand All @@ -97,7 +97,7 @@ bool common_hal_displayio_fourwire_reset(mp_obj_t obj) {

bool common_hal_displayio_fourwire_bus_free(mp_obj_t obj) {
displayio_fourwire_obj_t *self = MP_OBJ_TO_PTR(obj);
if (!common_hal_busio_spi_try_lock(self->bus)) {
if (common_hal_busio_spi_deinited(self->bus) || !common_hal_busio_spi_try_lock(self->bus)) {
return false;
}
common_hal_busio_spi_unlock(self->bus);
Expand All @@ -106,6 +106,10 @@ bool common_hal_displayio_fourwire_bus_free(mp_obj_t obj) {

bool common_hal_displayio_fourwire_begin_transaction(mp_obj_t obj) {
displayio_fourwire_obj_t *self = MP_OBJ_TO_PTR(obj);
if (common_hal_busio_spi_deinited(self->bus)) {
common_hal_displayio_fourwire_deinit(self);
return false;
}
if (!common_hal_busio_spi_try_lock(self->bus)) {
return false;
}
Expand Down
4 changes: 3 additions & 1 deletion shared-module/displayio/display_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,9 @@ void displayio_display_core_set_region_to_update(displayio_display_core_t *self,
}

// Set column.
displayio_display_core_begin_transaction(self);
if (!displayio_display_core_begin_transaction(self)) {
return;
}
uint8_t data[5];
data[0] = self->column_command;
uint8_t data_length = 1;
Expand Down