mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-19 09:00:54 +00:00
more mpw vs nto differences
This commit is contained in:
parent
6e1023e5ea
commit
a3ef478688
1 changed files with 7 additions and 1 deletions
|
|
@ -286,7 +286,10 @@ impl<'a> I2c<'a> {
|
||||||
let ret = match self.pending.take() {
|
let ret = match self.pending.take() {
|
||||||
I2cPending::Read(len) => {
|
I2cPending::Read(len) => {
|
||||||
if let Some(buf) = rx_buf {
|
if let Some(buf) = rx_buf {
|
||||||
|
#[cfg(feature = "mpw")]
|
||||||
buf[..len].copy_from_slice(&self.rx_buf[3..3 + len]);
|
buf[..len].copy_from_slice(&self.rx_buf[3..3 + len]);
|
||||||
|
#[cfg(not(feature = "mpw"))]
|
||||||
|
buf[..len].copy_from_slice(&self.rx_buf[..len]);
|
||||||
Ok(len)
|
Ok(len)
|
||||||
} else {
|
} else {
|
||||||
// the pending transaction was a read, but the user did not call us
|
// the pending transaction was a read, but the user did not call us
|
||||||
|
|
@ -408,8 +411,11 @@ impl<'a> I2c<'a> {
|
||||||
// safety: this is safe because the cmd_buf_phys() slice is passed to a function that only
|
// safety: this is safe because the cmd_buf_phys() slice is passed to a function that only
|
||||||
// uses it as a base/bounds reference and it will not actually access the data.
|
// uses it as a base/bounds reference and it will not actually access the data.
|
||||||
unsafe {
|
unsafe {
|
||||||
// the extra 3 are dummy bytes that were received while the address was being set up
|
// the extra 3 are dummy bytes that were received while the address was being set up - MPW bug
|
||||||
|
#[cfg(feature = "mpw")]
|
||||||
self.udma_enqueue(Bank::Rx, &self.rx_buf_phys[..len + 3], CFG_EN);
|
self.udma_enqueue(Bank::Rx, &self.rx_buf_phys[..len + 3], CFG_EN);
|
||||||
|
#[cfg(not(feature = "mpw"))]
|
||||||
|
self.udma_enqueue(Bank::Rx, &self.rx_buf_phys[..len], CFG_EN);
|
||||||
self.udma_enqueue(Bank::Custom, &self.cmd_buf_phys[..self.seq_len], CFG_EN);
|
self.udma_enqueue(Bank::Custom, &self.cmd_buf_phys[..self.seq_len], CFG_EN);
|
||||||
}
|
}
|
||||||
self.pending = I2cPending::Read(len);
|
self.pending = I2cPending::Read(len);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue