mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
check only the busy status bit for i2c to confirm command initiation
This commit is contained in:
parent
90317b0adb
commit
4d148c9a55
1 changed files with 2 additions and 3 deletions
|
|
@ -305,7 +305,6 @@ impl<'a> I2c<'a> {
|
|||
|
||||
fn busy(&self) -> bool {
|
||||
self.csr.rf(utra::udma_i2c_0::REG_STATUS_R_BUSY) != 0
|
||||
|| self.csr.rf(utra::udma_i2c_0::REG_STATUS_R_BUSY) != 0
|
||||
|| self.udma_busy(Bank::Custom)
|
||||
|| self.udma_busy(Bank::Tx)
|
||||
|| self.udma_busy(Bank::Rx)
|
||||
|
|
@ -361,7 +360,7 @@ impl<'a> I2c<'a> {
|
|||
self.udma_enqueue(Bank::Custom, &self.cmd_buf_phys[..self.seq_len], CFG_EN);
|
||||
}
|
||||
// wait for the commands to propagate before returning
|
||||
while !self.busy() {}
|
||||
while !self.csr.rf(utra::udma_i2c_0::REG_STATUS_R_BUSY) != 0 {}
|
||||
self.pending = I2cPending::Write(data.len());
|
||||
Ok(data.len())
|
||||
}
|
||||
|
|
@ -421,7 +420,7 @@ impl<'a> I2c<'a> {
|
|||
self.udma_enqueue(Bank::Custom, &self.cmd_buf_phys[..self.seq_len], CFG_EN);
|
||||
}
|
||||
// wait for the commands to propagate before returning
|
||||
while !self.busy() {}
|
||||
while !self.csr.rf(utra::udma_i2c_0::REG_STATUS_R_BUSY) != 0 {}
|
||||
self.pending = I2cPending::Read(len);
|
||||
Ok(len)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue