You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
taskI2C: reset I2C bus if cannot connect to MPU1 and MPU2 for too long
There are still certain corner cases which can cause the Arduino I2C bus
to become "stuck" -- it will not be able to make any successful I2C
communication after that regardless of whether the MPUs are connected
correctly or not.
Example of one such case: connect a wire to SDA (with the MPUs connected
as well). Rapidly attach and detach the other end of the wire to ground.
taskI2C will also rapidly report the MPUs as disconnected and connected,
and then finally stop at "the MPUs are disconnected", unable to
reconnect again.
Take the hard approach in fixing this: when we detect that both MPUs are
disconnected after 1 second, hard reset the Arduino's I2C bus, wait 1
second, and then re-enable it again. Some quick testing shows that this
works.
0 commit comments