summaryrefslogtreecommitdiff
path: root/shared-bindings/displayio/ParallelBus.c
diff options
context:
space:
mode:
authorLucian Copeland <hierophect@gmail.com>2020-04-15 10:29:05 -0400
committerLucian Copeland <hierophect@gmail.com>2020-04-15 10:29:05 -0400
commit54abfc2e8b88ed0dd1caaf3ac926466b0aba717a (patch)
treeb5154c84f807ee6ce3b0716b3a8d7b64dca46061 /shared-bindings/displayio/ParallelBus.c
parent0f87a75f4f0675ff55e31437907101226d5fb66b (diff)
parentae549fc9da555778884ff64a2ffe45df0a5248db (diff)
translations-merge
Diffstat (limited to 'shared-bindings/displayio/ParallelBus.c')
-rw-r--r--shared-bindings/displayio/ParallelBus.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/shared-bindings/displayio/ParallelBus.c b/shared-bindings/displayio/ParallelBus.c
index b3a876f90..4d9ffb0a1 100644
--- a/shared-bindings/displayio/ParallelBus.c
+++ b/shared-bindings/displayio/ParallelBus.c
@@ -83,18 +83,7 @@ STATIC mp_obj_t displayio_parallelbus_make_new(const mp_obj_type_t *type, size_t
mcu_pin_obj_t *read = validate_obj_is_free_pin(args[ARG_read].u_obj);
mcu_pin_obj_t *reset = validate_obj_is_free_pin(args[ARG_reset].u_obj);
- displayio_parallelbus_obj_t* self = NULL;
- for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) {
- if (displays[i].parallel_bus.base.type== NULL ||
- displays[i].parallel_bus.base.type == &mp_type_NoneType) {
- self = &displays[i].parallel_bus;
- self->base.type = &displayio_parallelbus_type;
- break;
- }
- }
- if (self == NULL) {
- mp_raise_RuntimeError(translate("Too many display busses"));
- }
+ displayio_parallelbus_obj_t* self = &allocate_display_bus_or_raise()->parallel_bus;
common_hal_displayio_parallelbus_construct(self, data0, command, chip_select, write, read, reset);
return self;