Skip to content

Commit 0fb9709

Browse files
committed
unlock secondary I2C singleton on reset
1 parent 5b53914 commit 0fb9709

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

shared-module/board/__init__.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ mp_obj_t common_hal_board_create_i2c(void) {
6868

6969

7070
#if BOARD_SECOND_I2C
71-
// Statically allocate the I2C object so it can live past the end of the heap and into the next VM.
72-
// That way it can be used by built-in I2CDisplay displays and be accessible through board.I2C().
71+
// This is the secondary I2C object, for boards that have an additional dedicated I2C port.
72+
// For example for board.STEMMA_I2C on the QT PY 2040.
7373
STATIC busio_i2c_obj_t second_i2c_obj;
7474
STATIC mp_obj_t second_i2c_singleton = NULL;
7575

@@ -186,6 +186,7 @@ void reset_board_busses(void) {
186186
}
187187
#endif
188188
if (second_i2c_singleton != NULL) {
189+
common_hal_busio_i2c_unlock(second_i2c_singleton);
189190
if (!display_using_second_i2c) {
190191
common_hal_busio_i2c_deinit(second_i2c_singleton);
191192
second_i2c_singleton = NULL;

0 commit comments

Comments
 (0)