Closed TG-Techie closed 4 years ago
The I2C bus hangs mentioned in that issue cannot be solved with timeouts in Python; timeouts have to be added in the C code at a low level where the bus status is checked.
This issue needs to be fixed in the CircuitPython core, not the bus_device library. I'm closing this in favor of https://github.com/adafruit/circuitpython/issues/2253
I noticed that on some devices (so far only nrf52840s) after many reboots all hardware locking hangs indefinitely. This modification adds timeouts to the bus devices (default of .25 seconds to be generous) where it will only try to lock for up to the specified amount of time. the timeout can be deactivated by passing
None
as the timeout. if the time runs out an exception of typeexception
is thrown. this code was tested on hardware similar to the feather nrf52840