Merge pull request #4801 from dhalbert/unlock-board-i2c-on-reset

unlock board.I2C() on reset
This commit is contained in:
Scott Shawcroft 2021-05-24 14:25:03 -07:00 committed by GitHub
commit de89fc7011
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -143,7 +143,9 @@ void reset_board_busses(void) {
} }
} }
#endif #endif
// make sure I2C lock is not held over a soft reset
if (i2c_singleton != NULL) { if (i2c_singleton != NULL) {
common_hal_busio_i2c_unlock(i2c_singleton);
if (!display_using_i2c) { if (!display_using_i2c) {
common_hal_busio_i2c_deinit(i2c_singleton); common_hal_busio_i2c_deinit(i2c_singleton);
i2c_singleton = NULL; i2c_singleton = NULL;