summaryrefslogtreecommitdiff
path: root/shared-module
diff options
context:
space:
mode:
authorChristian Walther <cwalther@gmx.ch>2020-10-24 17:13:10 +0200
committerChristian Walther <cwalther@gmx.ch>2020-10-26 22:44:38 +0100
commit1117edae63df7b66f1575980bf54d6836f9a8aa8 (patch)
treec861ea30d53ead79b200e987cd9c8ec02d339322 /shared-module
parent1e0f12d5045213bc94172d2fc6b60e2c05a76596 (diff)
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 #3581 for SPI. This needs to be solved in the same way for I2C and SPI.
Diffstat (limited to 'shared-module')
-rw-r--r--shared-module/board/__init__.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/shared-module/board/__init__.c b/shared-module/board/__init__.c
index 39b68a0f1..856103b7b 100644
--- a/shared-module/board/__init__.c
+++ b/shared-module/board/__init__.c
@@ -139,7 +139,7 @@ void reset_board_busses(void) {
bool display_using_i2c = false;
#if CIRCUITPY_DISPLAYIO
for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) {
- if (displays[i].i2cdisplay_bus.bus == i2c_singleton) {
+ if (displays[i].bus_base.type == &displayio_i2cdisplay_type && displays[i].i2cdisplay_bus.bus == i2c_singleton) {
display_using_i2c = true;
break;
}