Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-initialize I2C in a way that is safe from the ISR
Originally I2C was polled from the main loop, so it didn't matter that we did a full re-initialization of the peripheral on error. That calls into mbed, does lots of busy looping and waiting, and is generally slow. However as of 803a988 I2C is now polled from the ISR. That means we can't do crazy stuff like that any more. Instead, we do the minimum the datasheet requires, which is to disable the I2C peripheral, wait for its enable flag to report as 0, then re-enable it.
- Loading branch information