Merge pull request #3104 from birdistheword96/main
Fix: Ensure I2C bus is free before master-write operation
This commit is contained in:
commit
976e9f7fba
1 changed files with 5 additions and 0 deletions
|
@ -109,6 +109,11 @@ impl<'d, M: Mode> I2c<'d, M> {
|
|||
timeout.check()?;
|
||||
}
|
||||
|
||||
// Wait for the bus to be free
|
||||
while info.regs.isr().read().busy() {
|
||||
timeout.check()?;
|
||||
}
|
||||
|
||||
let reload = if reload {
|
||||
i2c::vals::Reload::NOTCOMPLETED
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue