Update to use new display construct.

This commit is contained in:
Eric Rong 2023-05-12 22:28:11 -07:00 committed by GitHub
parent 22665a113d
commit 91380f1957
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -66,7 +66,8 @@ uint8_t display_init_sequence[] = {
};
static void display_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
busio_spi_obj_t *spi = &bus->inline_bus;
common_hal_busio_spi_construct(
spi,
@ -77,7 +78,6 @@ static void display_init(void) {
common_hal_busio_spi_never_reset(spi);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(
@ -91,7 +91,7 @@ static void display_init(void) {
0 // phase
);
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(