8000 displayio: Fix "bus type" problem introduced at 8cba145c9029 · domdfcoding/circuitpython@507e17f · GitHub
[go: up one dir, main page]

Skip to content

Commit 507e17f

Browse files
committed
displayio: Fix "bus type" problem introduced at 8cba145
When allocate_display_bus_or_raise was factored out, the assignment of the bus's Python type was lost. Restore it. This would have affected displays of any type other than RGBMatrix, when they were created dynamically. Boards with displays configured in flash were unaffected. Closes: adafruit#2792
1 parent a4d86b9 commit 507e17f

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

shared-bindings/displayio/FourWire.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ STATIC mp_obj_t displayio_fourwire_make_new(const mp_obj_type_t *type, size_t n_
8484

8585
mp_obj_t spi = args[ARG_spi_bus].u_obj;
8686
displayio_fourwire_obj_t* self = &allocate_display_bus_or_raise()->fourwire_bus;
87+
self->base.type = &displayio_fourwire_type;
8788

8889
uint8_t polarity = args[ARG_polarity].u_int;
8990
if (polarity != 0 && polarity != 1) {

shared-bindings/displayio/I2CDisplay.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ STATIC mp_obj_t displayio_i2cdisplay_make_new(const mp_obj_type_t *type, size_t
7373

7474
mp_obj_t i2c = args[ARG_i2c_bus].u_obj;
7575
displayio_i2cdisplay_obj_t* self = &allocate_display_bus_or_raise()->i2cdisplay_bus;
76+
self->base.type = &displayio_i2cdisplay_type;
7677

7778
common_hal_displayio_i2cdisplay_construct(self,
7879
MP_OBJ_TO_PTR(i2c), args[ARG_device_address].u_int, reset);

shared-bindings/displayio/ParallelBus.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ STATIC mp_obj_t displayio_parallelbus_make_new(const mp_obj_type_t *type, size_t
8484
mcu_pin_obj_t *reset = validate_obj_is_free_pin(args[ARG_reset].u_obj);
8585

8686
displayio_parallelbus_obj_t* self = &allocate_display_bus_or_raise()->parallel_bus;
87+
self->base.type = &displayio_parallelbus_type;
8788

8889
common_hal_displayio_parallelbus_construct(self, data0, command, chip_select, write, read, reset);
8990
return self;

0 commit comments

Comments
 (0)
0