Skip to content

Fix FrameBufferDisplay, displayio_display_core_start_refresh & bus_free #3508

Closed
@jepler

Description

@jepler

#3507 papers over a problem where we called self->bus_free(self->bus); when bus_free was a NULL function pointer. In the case of RGBMatrix, this is fine. In the case of SharpDisplay, however, there is the possibility that the underlying SPI bus will be locked and we need to deal with it.

This could be done by

  • adding a new Framebuffer protocol to check for bus free (default/NULL function indicates bus is always free)
    • and implementing it for SharpDisplay, checking that the bus is in fact free
  • assigning this protocol to display_core.bus_free
  • removing the NULL check I added for self->bus

Presumably, without this fix, it is possible for a lockup to happen with an auto-refresh SharpDisplay and another foreground use of the SPI bus, including SD cards. However, I did not actually test anything in this area.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions