Skip to content

Commit 1f2beae

Browse files
committed
i2c display issue in library not core
1 parent 5672597 commit 1f2beae

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

shared-module/displayio/__init__.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
#include "supervisor/spi_flash_api.h"
5050
#endif
5151

52-
// The default indicates no primary display
53-
static int primary_display_number = -1;
52+
// The default indicates the first display is the primary display
53+
static int primary_display_number = 0;
5454
mp_int_t max_allocated_display = CIRCUITPY_DISPLAY_LIMIT;
5555

5656
primary_display_bus_t display_buses[CIRCUITPY_DISPLAY_LIMIT];
@@ -527,8 +527,7 @@ 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) &&
531-
(i >= CIRCUITPY_DISPLAY_LIMIT || (!is_display_active(DYN_DISPLAYS_ADR(i, display_base))))) {
530+
if (display_bus_type == NULL || display_bus_type == &mp_type_NoneType) {
532531
// Clear this memory so it is in a known state before init.
533532
memset(DYN_DISPLAY_BUSES_ADR0(i), 0, sizeof(display_buses[0]));
534533
#if CIRCUITPY_OS_GETENV && CIRCUITPY_SET_DISPLAY_LIMIT

0 commit comments

Comments
 (0)