Merge pull request #2797 from jepler/fix-2792

displayio: Fix "bus type" problem introduced at 8cba145c90
This commit is contained in:
Scott Shawcroft 2020-04-21 12:30:32 -07:00 committed by GitHub
commit 51dbe9109f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 0 deletions

View File

@ -84,6 +84,7 @@ STATIC mp_obj_t displayio_fourwire_make_new(const mp_obj_type_t *type, size_t n_
mp_obj_t spi = args[ARG_spi_bus].u_obj;
displayio_fourwire_obj_t* self = &allocate_display_bus_or_raise()->fourwire_bus;
self->base.type = &displayio_fourwire_type;
uint8_t polarity = args[ARG_polarity].u_int;
if (polarity != 0 && polarity != 1) {

View File

@ -73,6 +73,7 @@ STATIC mp_obj_t displayio_i2cdisplay_make_new(const mp_obj_type_t *type, size_t
mp_obj_t i2c = args[ARG_i2c_bus].u_obj;
displayio_i2cdisplay_obj_t* self = &allocate_display_bus_or_raise()->i2cdisplay_bus;
self->base.type = &displayio_i2cdisplay_type;
common_hal_displayio_i2cdisplay_construct(self,
MP_OBJ_TO_PTR(i2c), args[ARG_device_address].u_int, reset);

View File

@ -84,6 +84,7 @@ STATIC mp_obj_t displayio_parallelbus_make_new(const mp_obj_type_t *type, size_t
mcu_pin_obj_t *reset = validate_obj_is_free_pin(args[ARG_reset].u_obj);
displayio_parallelbus_obj_t* self = &allocate_display_bus_or_raise()->parallel_bus;
self->base.type = &displayio_parallelbus_type;
common_hal_displayio_parallelbus_construct(self, data0, command, chip_select, write, read, reset);
return self;