slight optimization to SPIM read

This commit is contained in:
bunnie 2024-05-05 16:39:59 +08:00
parent 76c1f9cb55
commit 6d7d3b244d

View file

@ -1263,10 +1263,6 @@ impl Spim {
CFG_EN | CFG_SIZE_8, CFG_EN | CFG_SIZE_8,
) )
} }
while self.udma_busy(Bank::Tx) {
#[cfg(feature = "std")]
xous::yield_slice();
}
let rd_cmd = [SpimCmd::RxData( let rd_cmd = [SpimCmd::RxData(
self.mode, self.mode,
SpimWordsPerXfer::Words1, SpimWordsPerXfer::Words1,
@ -1274,6 +1270,10 @@ impl Spim {
SpimEndian::MsbFirst, SpimEndian::MsbFirst,
chunk.len() as u32, chunk.len() as u32,
)]; )];
while self.udma_busy(Bank::Tx) {
#[cfg(feature = "std")]
xous::yield_slice();
}
self.send_cmd_list(&rd_cmd); self.send_cmd_list(&rd_cmd);
// safety: this is safe because rx_buf_phys() slice is only used as a base/bounds reference // safety: this is safe because rx_buf_phys() slice is only used as a base/bounds reference
unsafe { unsafe {