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
This commit brings back the while-loop waiting at the end of the
blocking read/write methods on I2C. The while-loop waiting is necessary
to ensure that the I2C interface has become idle before returning from
the blocking read/write methods.
As an example, the following code might break without the while-loop
waiting. Assuming that `handle` is a DMA handle to an I2C interface.
After the first write method returns, without the while-loop waiting,
the I2C interface can be generating the stop condition when the code
reaches the second `write` method, which then fails the busy test
`self.busy_res()?` and causes the second `write` to return `WouldBlock`.
```
handle.write(addr, buf); // Ok(())
handle.write(addr, buf); // Err(WouldBlock)
```
The added while-loop affects only the blocking methods and will not
affect the non-blocking methods with DMA.
0 commit comments