Skip to content

Commit 5672597

Browse files
committed
static display bus doesn't show up, assume used if static display exists
1 parent 4a7081c commit 5672597

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

shared-module/displayio/__init__.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,8 @@ primary_display_t *allocate_display_or_raise(void) {
527527
primary_display_bus_t *allocate_display_bus(void) {
528528
for (uint8_t i = 0; i < max_allocated_display; i++) {
529529
mp_const_obj_t display_bus_type = DYN_DISPLAY_BUSES(i).bus_base.type;
530-
if (display_bus_type == NULL || display_bus_type == &mp_type_NoneType) {
530+
if ((display_bus_type == NULL || display_bus_type == &mp_type_NoneType) &&
531+
(i >= CIRCUITPY_DISPLAY_LIMIT || (!is_display_active(DYN_DISPLAYS_ADR(i, display_base))))) {
531532
// Clear this memory so it is in a known state before init.
532533
memset(DYN_DISPLAY_BUSES_ADR0(i), 0, sizeof(display_buses[0]));
533534
#if CIRCUITPY_OS_GETENV && CIRCUITPY_SET_DISPLAY_LIMIT

0 commit comments

Comments
 (0)