replace inspect() with direct calls to trace!() after awaiting

This commit is contained in:
kbleeke 2023-03-21 19:39:41 +01:00
parent 29494a9296
commit 359b1c7fdb
2 changed files with 12 additions and 20 deletions

View File

@ -155,13 +155,13 @@ where
SM: PioStateMachine,
DMA: Channel,
{
async fn cmd_write(&mut self, write: & [u32]) {
async fn cmd_write(&mut self, write: &[u32]) {
self.cs.set_low();
self.write(write).await;
self.cs.set_high();
}
async fn cmd_read(&mut self, write: u32, read: & mut [u32]) {
async fn cmd_read(&mut self, write: u32, read: &mut [u32]) {
self.cs.set_low();
self.cmd_read(write, read).await;
self.cs.set_high();

View File

@ -55,32 +55,24 @@ where
{}
self.write32_swapped(REG_BUS_TEST_RW, TEST_PATTERN).await;
let val = self
.read32_swapped(REG_BUS_TEST_RW)
.inspect(|v| defmt::trace!("{:#x}", v))
.await;
let val = self.read32_swapped(REG_BUS_TEST_RW).await;
defmt::trace!("{:#x}", val);
assert_eq!(val, TEST_PATTERN);
self.read32_swapped(REG_BUS_CTRL)
.inspect(|v| defmt::trace!("{:#010b}", (v & 0xff)))
.await;
let val = self.read32_swapped(REG_BUS_CTRL).await;
defmt::trace!("{:#010b}", (val & 0xff));
// 32-bit word length, little endian (which is the default endianess).
self.write32_swapped(REG_BUS_CTRL, WORD_LENGTH_32 | HIGH_SPEED).await;
self.read8(FUNC_BUS, REG_BUS_CTRL)
.inspect(|v| defmt::trace!("{:#b}", v))
.await;
let val = self.read8(FUNC_BUS, REG_BUS_CTRL).await;
defmt::trace!("{:#b}", val);
let val = self
.read32(FUNC_BUS, REG_BUS_TEST_RO)
.inspect(|v| defmt::trace!("{:#x}", v))
.await;
let val = self.read32(FUNC_BUS, REG_BUS_TEST_RO).await;
defmt::trace!("{:#x}", val);
assert_eq!(val, FEEDBEAD);
let val = self
.read32(FUNC_BUS, REG_BUS_TEST_RW)
.inspect(|v| defmt::trace!("{:#x}", v))
.await;
let val = self.read32(FUNC_BUS, REG_BUS_TEST_RW).await;
defmt::trace!("{:#x}", val);
assert_eq!(val, TEST_PATTERN);
}