8000 Fix erroneous claim of board.I2C() by deinited display. · domdfcoding/circuitpython@1117eda · GitHub
[go: up one dir, main page]

Skip to content

Commit 1117eda

Browse files
committed
Fix erroneous claim of board.I2C() by deinited display.
At the end of a session that called displayio.release_displays() (and did not initialize a new display), a board.I2C() bus that was previously used by a display would wrongly be considered still in use. While I can’t think of any unrecoverable problem this would cause in the next session, it violates the assumption that a soft reboot resets everything not needed by displays, potentially leading to confusion. By itself, this change does not fix the problem yet - rather, it introduces the same issue as in adafruit#3581 for SPI. This needs to be solved in the same way for I2C and SPI.
1 parent 1e0f12d commit 1117eda

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

shared-module/board/__init__.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ void reset_board_busses(void) {
139139
bool display_using_i2c = false;
140140
#if CIRCUITPY_DISPLAYIO
141141
for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) {
142-
if (displays[i].i2cdisplay_bus.bus == i2c_singleton) {
142+
if (displays[i].bus_base.type == &displayio_i2cdisplay_ty 492A pe && displays[i].i2cdisplay_bus.bus == i2c_singleton) {
143143
display_using_i2c = true;
144144
break;
145145
}

0 commit comments

Comments
 (0)
0