summaryrefslogtreecommitdiff
path: root/shared-module/displayio
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2020-10-02 15:07:36 -0500
committerJeff Epler <jepler@gmail.com>2020-10-02 15:07:36 -0500
commitb1592564b286ca7a5374e77eba2c2efc768ffae9 (patch)
tree5c7694404e3845a7e70c4090e62409e302c45fd1 /shared-module/displayio
parente114b5ab54e3c7f4a36a03dae2913cb76804efa3 (diff)
displayio: Fix matrixportal crash
An RGBMatrix has no bus and no bus_free method. It is always possible to refresh the display. This was not a problem before, but the fix I suggested (#3449) added a call to core_bus_free when a FramebufferDisplay was being refreshed. This was not caught during testing. This is a band-aid fix and it brings to light a second problem in which a SharpDisplay + FrameBuffer will not have a 'bus' object, and yet does operate using a shared SPI bus. This kind of display will need a "bus-free" like function to be added, or it can have problems like #3309.
Diffstat (limited to 'shared-module/displayio')
-rw-r--r--shared-module/displayio/display_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/shared-module/displayio/display_core.c b/shared-module/displayio/display_core.c
index 68572c44f..35d0c74a4 100644
--- a/shared-module/displayio/display_core.c
+++ b/shared-module/displayio/display_core.c
@@ -197,7 +197,7 @@ bool displayio_display_core_get_dither(displayio_display_core_t* self){
}
bool displayio_display_core_bus_free(displayio_display_core_t *self) {
- return self->bus_free(self->bus);
+ return !self->bus || self->bus_free(self->bus);
}
bool displayio_display_core_begin_transaction(displayio_display_core_t* self) {