displayio: fix releasing dot clock framebuffres in release_displays

this caused problems particularly when the framebuffer was not associated
with a display.
This commit is contained in:
Jeff Epler 2023-09-25 09:45:35 -05:00
parent 1c0155c99b
commit 409d1a83b6
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE

View File

@ -43,6 +43,10 @@
#include "supervisor/spi_flash_api.h" #include "supervisor/spi_flash_api.h"
#include "py/mpconfig.h" #include "py/mpconfig.h"
#if CIRCUITPY_DOTCLOCKFRAMEBUFFER
#include "shared-bindings/dotclockframebuffer/DotClockFramebuffer.h"
#endif
#if CIRCUITPY_SHARPDISPLAY #if CIRCUITPY_SHARPDISPLAY
#include "shared-bindings/sharpdisplay/SharpMemoryFramebuffer.h" #include "shared-bindings/sharpdisplay/SharpMemoryFramebuffer.h"
#include "shared-module/sharpdisplay/SharpMemoryFramebuffer.h" #include "shared-module/sharpdisplay/SharpMemoryFramebuffer.h"
@ -133,6 +137,10 @@ void common_hal_displayio_release_displays(void) {
common_hal_displayio_fourwire_deinit(&display_buses[i].fourwire_bus); common_hal_displayio_fourwire_deinit(&display_buses[i].fourwire_bus);
} else if (bus_type == &displayio_i2cdisplay_type) { } else if (bus_type == &displayio_i2cdisplay_type) {
common_hal_displayio_i2cdisplay_deinit(&display_buses[i].i2cdisplay_bus); common_hal_displayio_i2cdisplay_deinit(&display_buses[i].i2cdisplay_bus);
#if CIRCUITPY_DOTCLOCKFRAMEBUFFER
} else if (bus_type == &dotclockframebuffer_framebuffer_type) {
common_hal_dotclockframebuffer_framebuffer_deinit(&display_buses[i].dotclock);
#endif
#if CIRCUITPY_PARALLELDISPLAY #if CIRCUITPY_PARALLELDISPLAY
} else if (bus_type == &paralleldisplay_parallelbus_type) { } else if (bus_type == &paralleldisplay_parallelbus_type) {
common_hal_paralleldisplay_parallelbus_deinit(&display_buses[i].parallel_bus); common_hal_paralleldisplay_parallelbus_deinit(&display_buses[i].parallel_bus);