diff --git a/CHANGELOG.md b/CHANGELOG.md index 59e542c89d2..4822da3989b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Remove the `allow-opt-level-z` feature from `esp32c3-hal` (#654) +### Breaking + +- `DmaTransfer::wait` and `I2sReadDmaTransfer::wait_receive` now return `Result` (#665) + ## [0.10.0] - 2023-06-04 ### Added diff --git a/esp-hal-common/src/dma/mod.rs b/esp-hal-common/src/dma/mod.rs index 7e4f604a3c8..a09b9d8723d 100644 --- a/esp-hal-common/src/dma/mod.rs +++ b/esp-hal-common/src/dma/mod.rs @@ -221,6 +221,8 @@ pub trait RxPrivate { fn drain_buffer(&mut self, dst: &mut [u8]) -> Result; + fn has_error(&self) -> bool; + #[cfg(feature = "async")] fn waker() -> &'static embassy_sync::waitqueue::AtomicWaker; } @@ -474,6 +476,10 @@ where R::unlisten_in_eof() } + fn has_error(&self) -> bool { + R::has_in_descriptor_error() + } + #[cfg(feature = "async")] fn waker() -> &'static embassy_sync::waitqueue::AtomicWaker { T::waker() @@ -504,6 +510,8 @@ pub trait TxPrivate { fn available(&mut self) -> usize; + fn has_error(&self) -> bool; + fn push(&mut self, data: &[u8]) -> Result; #[cfg(feature = "async")] @@ -790,6 +798,10 @@ where R::unlisten_out_eof() } + fn has_error(&self) -> bool { + R::has_out_descriptor_error() + } + #[cfg(feature = "async")] fn waker() -> &'static embassy_sync::waitqueue::AtomicWaker { T::waker() @@ -850,7 +862,7 @@ where #[allow(drop_bounds)] pub trait DmaTransfer: Drop { /// Wait for the transfer to finish. - fn wait(self) -> (B, T); + fn wait(self) -> Result<(B, T), (DmaError, B, T)>; /// Check if the transfer is finished. fn is_done(&self) -> bool; } @@ -859,7 +871,7 @@ pub trait DmaTransfer: Drop { #[allow(drop_bounds)] pub trait DmaTransferRxTx: Drop { /// Wait for the transfer to finish. - fn wait(self) -> (BR, BT, T); + fn wait(self) -> Result<(BR, BT, T), (DmaError, BR, BT, T)>; /// Check if the transfer is finished. fn is_done(&self) -> bool; } diff --git a/esp-hal-common/src/i2s.rs b/esp-hal-common/src/i2s.rs index 7b4487f0a54..ee1e59a0c5f 100644 --- a/esp-hal-common/src/i2s.rs +++ b/esp-hal-common/src/i2s.rs @@ -318,7 +318,9 @@ where { /// Wait for the DMA transfer to complete and return the buffers and the /// I2sTx instance. - fn wait(self) -> (BUFFER, I2sTx<'d, T, P, CH>) { + fn wait( + self, + ) -> Result<(BUFFER, I2sTx<'d, T, P, CH>), (DmaError, BUFFER, I2sTx<'d, T, P, CH>)> { self.i2s_tx.wait_tx_dma_done().ok(); // waiting for the DMA transfer is not enough // `DmaTransfer` needs to have a `Drop` implementation, because we accept @@ -331,8 +333,13 @@ where unsafe { let buffer = core::ptr::read(&self.buffer); let payload = core::ptr::read(&self.i2s_tx); + let err = (&self).i2s_tx.tx_channel.has_error(); core::mem::forget(self); - (buffer, payload) + if err { + Err((DmaError::DescriptorError, buffer, payload)) + } else { + Ok((buffer, payload)) + } } } @@ -412,7 +419,11 @@ where /// I2sTx instance after copying the read data to the given buffer. /// Length of the received data is returned at the third element of the /// tuple. - pub fn wait_receive(mut self, dst: &mut [u8]) -> (BUFFER, I2sRx<'d, T, P, CH>, usize) { + pub fn wait_receive( + mut self, + dst: &mut [u8], + ) -> Result<(BUFFER, I2sRx<'d, T, P, CH>, usize), (DmaError, BUFFER, I2sRx<'d, T, P, CH>, usize)> + { self.i2s_rx.wait_rx_dma_done().ok(); // waiting for the DMA transfer is not enough let len = self.i2s_rx.rx_channel.drain_buffer(dst).unwrap(); @@ -427,8 +438,13 @@ where unsafe { let buffer = core::ptr::read(&self.buffer); let payload = core::ptr::read(&self.i2s_rx); + let err = (&self).i2s_rx.rx_channel.has_error(); core::mem::forget(self); - (buffer, payload, len) + if err { + Err((DmaError::DescriptorError, buffer, payload, len)) + } else { + Ok((buffer, payload, len)) + } } } } @@ -442,7 +458,9 @@ where { /// Wait for the DMA transfer to complete and return the buffers and the /// I2sTx instance. - fn wait(self) -> (BUFFER, I2sRx<'d, T, P, CH>) { + fn wait( + self, + ) -> Result<(BUFFER, I2sRx<'d, T, P, CH>), (DmaError, BUFFER, I2sRx<'d, T, P, CH>)> { self.i2s_rx.wait_rx_dma_done().ok(); // waiting for the DMA transfer is not enough // `DmaTransfer` needs to have a `Drop` implementation, because we accept @@ -455,8 +473,13 @@ where unsafe { let buffer = core::ptr::read(&self.buffer); let payload = core::ptr::read(&self.i2s_rx); + let err = (&self).i2s_rx.rx_channel.has_error(); core::mem::forget(self); - (buffer, payload) + if err { + Err((DmaError::DescriptorError, buffer, payload)) + } else { + Ok((buffer, payload)) + } } } diff --git a/esp-hal-common/src/spi.rs b/esp-hal-common/src/spi.rs index 35b47bbc815..71d907212c5 100644 --- a/esp-hal-common/src/spi.rs +++ b/esp-hal-common/src/spi.rs @@ -756,6 +756,7 @@ pub mod dma { dma::{ Channel, ChannelTypes, + DmaError, DmaTransfer, DmaTransferRxTx, RxPrivate, @@ -846,7 +847,12 @@ pub mod dma { { /// Wait for the DMA transfer to complete and return the buffers and the /// SPI instance. - fn wait(mut self) -> (RXBUF, TXBUF, SpiDma<'d, T, C, M>) { + fn wait( + mut self, + ) -> Result< + (RXBUF, TXBUF, SpiDma<'d, T, C, M>), + (DmaError, RXBUF, TXBUF, SpiDma<'d, T, C, M>), + > { self.spi_dma.spi.flush().ok(); // waiting for the DMA transfer is not enough // `DmaTransfer` needs to have a `Drop` implementation, because we accept @@ -860,8 +866,14 @@ pub mod dma { let rbuffer = core::ptr::read(&self.rbuffer); let tbuffer = core::ptr::read(&self.tbuffer); let payload = core::ptr::read(&self.spi_dma); + let err = (&self).spi_dma.channel.rx.has_error() + || (&self).spi_dma.channel.tx.has_error(); mem::forget(self); - (rbuffer, tbuffer, payload) + if err { + Err((DmaError::DescriptorError, rbuffer, tbuffer, payload)) + } else { + Ok((rbuffer, tbuffer, payload)) + } } } @@ -906,7 +918,10 @@ pub mod dma { { /// Wait for the DMA transfer to complete and return the buffers and the /// SPI instance. - fn wait(mut self) -> (BUFFER, SpiDma<'d, T, C, M>) { + fn wait( + mut self, + ) -> Result<(BUFFER, SpiDma<'d, T, C, M>), (DmaError, BUFFER, SpiDma<'d, T, C, M>)> + { self.spi_dma.spi.flush().ok(); // waiting for the DMA transfer is not enough // `DmaTransfer` needs to have a `Drop` implementation, because we accept @@ -919,8 +934,14 @@ pub mod dma { unsafe { let buffer = core::ptr::read(&self.buffer); let payload = core::ptr::read(&self.spi_dma); + let err = (&self).spi_dma.channel.rx.has_error() + || (&self).spi_dma.channel.tx.has_error(); mem::forget(self); - (buffer, payload) + if err { + Err((DmaError::DescriptorError, buffer, payload)) + } else { + Ok((buffer, payload)) + } } } @@ -955,6 +976,17 @@ pub mod dma { _mode: PhantomData, } + impl<'d, T, C, M> core::fmt::Debug for SpiDma<'d, T, C, M> + where + C: ChannelTypes, + C::P: SpiPeripheral, + M: DuplexMode, + { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + f.debug_struct("SpiDma").finish() + } + } + impl<'d, T, C, M> SpiDma<'d, T, C, M> where T: InstanceDma, C::Rx<'d>>, diff --git a/esp32-hal/examples/qspi_flash.rs b/esp32-hal/examples/qspi_flash.rs index 8ec01a6560c..c1327115c2f 100644 --- a/esp32-hal/examples/qspi_flash.rs +++ b/esp32-hal/examples/qspi_flash.rs @@ -109,7 +109,7 @@ fn main() -> ! { zero_buf, ) .unwrap(); - (zero_buf, spi) = transfer.wait(); + (zero_buf, spi) = transfer.wait().unwrap(); delay.delay_ms(250u32); // erase sector @@ -122,7 +122,7 @@ fn main() -> ! { zero_buf, ) .unwrap(); - (zero_buf, spi) = transfer.wait(); + (zero_buf, spi) = transfer.wait().unwrap(); delay.delay_ms(250u32); // write enable @@ -135,7 +135,7 @@ fn main() -> ! { zero_buf, ) .unwrap(); - (_, spi) = transfer.wait(); + (_, spi) = transfer.wait().unwrap(); delay.delay_ms(250u32); // write data / program page @@ -150,7 +150,7 @@ fn main() -> ! { send, ) .unwrap(); - (_, spi) = transfer.wait(); + (_, spi) = transfer.wait().unwrap(); delay.delay_ms(250u32); loop { @@ -168,7 +168,7 @@ fn main() -> ! { // here we could do something else while DMA transfer is in progress // the buffers and spi is moved into the transfer and we can get it back via // `wait` - (receive, spi) = transfer.wait(); + (receive, spi) = transfer.wait().unwrap(); println!("{:x?}", &receive); for b in &mut receive.iter() { diff --git a/esp32-hal/examples/spi_loopback_dma.rs b/esp32-hal/examples/spi_loopback_dma.rs index 54871609470..8f0a4549fb1 100644 --- a/esp32-hal/examples/spi_loopback_dma.rs +++ b/esp32-hal/examples/spi_loopback_dma.rs @@ -107,7 +107,7 @@ fn main() -> ! { } // the buffers and spi is moved into the transfer and we can get it back via // `wait` - (receive, send, spi) = transfer.wait(); + (receive, send, spi) = transfer.wait().unwrap(); println!( "{:x?} .. {:x?}", &receive[..10], diff --git a/esp32c2-hal/examples/qspi_flash.rs b/esp32c2-hal/examples/qspi_flash.rs index c989460e75a..3140a0fbadf 100644 --- a/esp32c2-hal/examples/qspi_flash.rs +++ b/esp32c2-hal/examples/qspi_flash.rs @@ -103,7 +103,7 @@ fn main() -> ! { zero_buf, ) .unwrap(); - (zero_buf, spi) = transfer.wait(); + (zero_buf, spi) = transfer.wait().unwrap(); delay.delay_ms(250u32); // erase sector @@ -116,7 +116,7 @@ fn main() -> ! { zero_buf, ) .unwrap(); - (zero_buf, spi) = transfer.wait(); + (zero_buf, spi) = transfer.wait().unwrap(); delay.delay_ms(250u32); // write enable @@ -129,7 +129,7 @@ fn main() -> ! { zero_buf, ) .unwrap(); - (_, spi) = transfer.wait(); + (_, spi) = transfer.wait().unwrap(); delay.delay_ms(250u32); // write data / program page @@ -144,7 +144,7 @@ fn main() -> ! { send, ) .unwrap(); - (_, spi) = transfer.wait(); + (_, spi) = transfer.wait().unwrap(); delay.delay_ms(250u32); loop { @@ -162,7 +162,7 @@ fn main() -> ! { // here we could do something else while DMA transfer is in progress // the buffers and spi is moved into the transfer and we can get it back via // `wait` - (receive, spi) = transfer.wait(); + (receive, spi) = transfer.wait().unwrap(); println!("{:x?}", &receive); for b in &mut receive.iter() { diff --git a/esp32c2-hal/examples/spi_loopback_dma.rs b/esp32c2-hal/examples/spi_loopback_dma.rs index 529ec1b0c1d..06bcff6e0f1 100644 --- a/esp32c2-hal/examples/spi_loopback_dma.rs +++ b/esp32c2-hal/examples/spi_loopback_dma.rs @@ -108,7 +108,7 @@ fn main() -> ! { } // the buffers and spi is moved into the transfer and we can get it back via // `wait` - (receive, send, spi) = transfer.wait(); + (receive, send, spi) = transfer.wait().unwrap(); println!( "{:x?} .. {:x?}", &receive[..10], diff --git a/esp32c3-hal/examples/qspi_flash.rs b/esp32c3-hal/examples/qspi_flash.rs index 51f0c2185a3..cf831838850 100644 --- a/esp32c3-hal/examples/qspi_flash.rs +++ b/esp32c3-hal/examples/qspi_flash.rs @@ -110,7 +110,7 @@ fn main() -> ! { zero_buf, ) .unwrap(); - (zero_buf, spi) = transfer.wait(); + (zero_buf, spi) = transfer.wait().unwrap(); delay.delay_ms(250u32); // erase sector @@ -123,7 +123,7 @@ fn main() -> ! { zero_buf, ) .unwrap(); - (zero_buf, spi) = transfer.wait(); + (zero_buf, spi) = transfer.wait().unwrap(); delay.delay_ms(250u32); // write enable @@ -136,7 +136,7 @@ fn main() -> ! { zero_buf, ) .unwrap(); - (_, spi) = transfer.wait(); + (_, spi) = transfer.wait().unwrap(); delay.delay_ms(250u32); // write data / program page @@ -151,7 +151,7 @@ fn main() -> ! { send, ) .unwrap(); - (_, spi) = transfer.wait(); + (_, spi) = transfer.wait().unwrap(); delay.delay_ms(250u32); loop { @@ -169,7 +169,7 @@ fn main() -> ! { // here we could do something else while DMA transfer is in progress // the buffers and spi is moved into the transfer and we can get it back via // `wait` - (receive, spi) = transfer.wait(); + (receive, spi) = transfer.wait().unwrap(); println!("{:x?}", &receive); for b in &mut receive.iter() { diff --git a/esp32c3-hal/examples/spi_loopback_dma.rs b/esp32c3-hal/examples/spi_loopback_dma.rs index f612b86013a..3203a8d7103 100644 --- a/esp32c3-hal/examples/spi_loopback_dma.rs +++ b/esp32c3-hal/examples/spi_loopback_dma.rs @@ -115,7 +115,7 @@ fn main() -> ! { } // the buffers and spi is moved into the transfer and we can get it back via // `wait` - (receive, send, spi) = transfer.wait(); + (receive, send, spi) = transfer.wait().unwrap(); println!( "{:x?} .. {:x?}", &receive[..10], diff --git a/esp32c6-hal/examples/qspi_flash.rs b/esp32c6-hal/examples/qspi_flash.rs index b2e79e6cf30..886ded195a6 100644 --- a/esp32c6-hal/examples/qspi_flash.rs +++ b/esp32c6-hal/examples/qspi_flash.rs @@ -110,7 +110,7 @@ fn main() -> ! { zero_buf, ) .unwrap(); - (zero_buf, spi) = transfer.wait(); + (zero_buf, spi) = transfer.wait().unwrap(); delay.delay_ms(250u32); // erase sector @@ -123,7 +123,7 @@ fn main() -> ! { zero_buf, ) .unwrap(); - (zero_buf, spi) = transfer.wait(); + (zero_buf, spi) = transfer.wait().unwrap(); delay.delay_ms(250u32); // write enable @@ -136,7 +136,7 @@ fn main() -> ! { zero_buf, ) .unwrap(); - (_, spi) = transfer.wait(); + (_, spi) = transfer.wait().unwrap(); delay.delay_ms(250u32); // write data / program page @@ -151,7 +151,7 @@ fn main() -> ! { send, ) .unwrap(); - (_, spi) = transfer.wait(); + (_, spi) = transfer.wait().unwrap(); delay.delay_ms(250u32); loop { @@ -169,7 +169,7 @@ fn main() -> ! { // here we could do something else while DMA transfer is in progress // the buffers and spi is moved into the transfer and we can get it back via // `wait` - (receive, spi) = transfer.wait(); + (receive, spi) = transfer.wait().unwrap(); println!("{:x?}", &receive); for b in &mut receive.iter() { diff --git a/esp32c6-hal/examples/spi_loopback_dma.rs b/esp32c6-hal/examples/spi_loopback_dma.rs index 7f72e664d4b..bcc1ee57592 100644 --- a/esp32c6-hal/examples/spi_loopback_dma.rs +++ b/esp32c6-hal/examples/spi_loopback_dma.rs @@ -116,7 +116,7 @@ fn main() -> ! { } // the buffers and spi is moved into the transfer and we can get it back via // `wait` - (receive, send, spi) = transfer.wait(); + (receive, send, spi) = transfer.wait().unwrap(); println!( "{:x?} .. {:x?}", &receive[..10], diff --git a/esp32h2-hal/examples/qspi_flash.rs b/esp32h2-hal/examples/qspi_flash.rs index 59961e54381..4278c76ce88 100644 --- a/esp32h2-hal/examples/qspi_flash.rs +++ b/esp32h2-hal/examples/qspi_flash.rs @@ -110,7 +110,7 @@ fn main() -> ! { zero_buf, ) .unwrap(); - (zero_buf, spi) = transfer.wait(); + (zero_buf, spi) = transfer.wait().unwrap(); delay.delay_ms(250u32); // erase sector @@ -123,7 +123,7 @@ fn main() -> ! { zero_buf, ) .unwrap(); - (zero_buf, spi) = transfer.wait(); + (zero_buf, spi) = transfer.wait().unwrap(); delay.delay_ms(250u32); // write enable @@ -136,7 +136,7 @@ fn main() -> ! { zero_buf, ) .unwrap(); - (_, spi) = transfer.wait(); + (_, spi) = transfer.wait().unwrap(); delay.delay_ms(250u32); // write data / program page @@ -151,7 +151,7 @@ fn main() -> ! { send, ) .unwrap(); - (_, spi) = transfer.wait(); + (_, spi) = transfer.wait().unwrap(); delay.delay_ms(250u32); loop { @@ -169,7 +169,7 @@ fn main() -> ! { // here we could do something else while DMA transfer is in progress // the buffers and spi is moved into the transfer and we can get it back via // `wait` - (receive, spi) = transfer.wait(); + (receive, spi) = transfer.wait().unwrap(); println!("{:x?}", &receive); for b in &mut receive.iter() { diff --git a/esp32h2-hal/examples/rmt_tx.rs b/esp32h2-hal/examples/rmt_tx.rs index 4ef2c34ef1a..aeda3b555bd 100644 --- a/esp32h2-hal/examples/rmt_tx.rs +++ b/esp32h2-hal/examples/rmt_tx.rs @@ -20,7 +20,7 @@ use esp_backtrace as _; #[entry] fn main() -> ! { let peripherals = Peripherals::take(); - let mut system = peripherals.PCR.split(); + let system = peripherals.PCR.split(); let mut clock_control = system.peripheral_clock_control; let clocks = ClockControl::boot_defaults(system.clock_control).freeze(); diff --git a/esp32h2-hal/examples/spi_loopback_dma.rs b/esp32h2-hal/examples/spi_loopback_dma.rs index 4b19bf688aa..6ec13e64454 100644 --- a/esp32h2-hal/examples/spi_loopback_dma.rs +++ b/esp32h2-hal/examples/spi_loopback_dma.rs @@ -109,7 +109,7 @@ fn main() -> ! { // here we could do something else while DMA transfer is in progress // the buffers and spi is moved into the transfer and we can get it back via // `wait` - (receive, send, spi) = transfer.wait(); + (receive, send, spi) = transfer.wait().unwrap(); println!( "{:x?} .. {:x?}", &receive[..10], diff --git a/esp32s2-hal/examples/qspi_flash.rs b/esp32s2-hal/examples/qspi_flash.rs index 581c44b349e..6e9cacf64d0 100644 --- a/esp32s2-hal/examples/qspi_flash.rs +++ b/esp32s2-hal/examples/qspi_flash.rs @@ -109,7 +109,7 @@ fn main() -> ! { zero_buf, ) .unwrap(); - (zero_buf, spi) = transfer.wait(); + (zero_buf, spi) = transfer.wait().unwrap(); delay.delay_ms(250u32); // erase sector @@ -122,7 +122,7 @@ fn main() -> ! { zero_buf, ) .unwrap(); - (zero_buf, spi) = transfer.wait(); + (zero_buf, spi) = transfer.wait().unwrap(); delay.delay_ms(250u32); // write enable @@ -135,7 +135,7 @@ fn main() -> ! { zero_buf, ) .unwrap(); - (_, spi) = transfer.wait(); + (_, spi) = transfer.wait().unwrap(); delay.delay_ms(250u32); // write data / program page @@ -150,7 +150,7 @@ fn main() -> ! { send, ) .unwrap(); - (_, spi) = transfer.wait(); + (_, spi) = transfer.wait().unwrap(); delay.delay_ms(250u32); loop { @@ -168,7 +168,7 @@ fn main() -> ! { // here we could do something else while DMA transfer is in progress // the buffers and spi is moved into the transfer and we can get it back via // `wait` - (receive, spi) = transfer.wait(); + (receive, spi) = transfer.wait().unwrap(); println!("{:x?}", &receive); for b in &mut receive.iter() { diff --git a/esp32s2-hal/examples/spi_loopback_dma.rs b/esp32s2-hal/examples/spi_loopback_dma.rs index 35133684d02..c688432f40a 100644 --- a/esp32s2-hal/examples/spi_loopback_dma.rs +++ b/esp32s2-hal/examples/spi_loopback_dma.rs @@ -107,7 +107,7 @@ fn main() -> ! { } // the buffers and spi is moved into the transfer and we can get it back via // `wait` - (receive, send, spi) = transfer.wait(); + (receive, send, spi) = transfer.wait().unwrap(); println!( "{:x?} .. {:x?}", &receive[..10], diff --git a/esp32s3-hal/examples/qspi_flash.rs b/esp32s3-hal/examples/qspi_flash.rs index bbd5b9929b2..17c3057d08a 100644 --- a/esp32s3-hal/examples/qspi_flash.rs +++ b/esp32s3-hal/examples/qspi_flash.rs @@ -110,7 +110,7 @@ fn main() -> ! { zero_buf, ) .unwrap(); - (zero_buf, spi) = transfer.wait(); + (zero_buf, spi) = transfer.wait().unwrap(); delay.delay_ms(250u32); // erase sector @@ -123,7 +123,7 @@ fn main() -> ! { zero_buf, ) .unwrap(); - (zero_buf, spi) = transfer.wait(); + (zero_buf, spi) = transfer.wait().unwrap(); delay.delay_ms(250u32); // write enable @@ -136,7 +136,7 @@ fn main() -> ! { zero_buf, ) .unwrap(); - (_, spi) = transfer.wait(); + (_, spi) = transfer.wait().unwrap(); delay.delay_ms(250u32); // write data / program page @@ -151,7 +151,7 @@ fn main() -> ! { send, ) .unwrap(); - (_, spi) = transfer.wait(); + (_, spi) = transfer.wait().unwrap(); delay.delay_ms(250u32); loop { @@ -169,7 +169,7 @@ fn main() -> ! { // here we could do something else while DMA transfer is in progress // the buffers and spi is moved into the transfer and we can get it back via // `wait` - (receive, spi) = transfer.wait(); + (receive, spi) = transfer.wait().unwrap(); println!("{:x?}", &receive); for b in &mut receive.iter() { diff --git a/esp32s3-hal/examples/rmt_tx.rs b/esp32s3-hal/examples/rmt_tx.rs index c1ae5f75432..5bb1b733588 100644 --- a/esp32s3-hal/examples/rmt_tx.rs +++ b/esp32s3-hal/examples/rmt_tx.rs @@ -18,7 +18,6 @@ use esp_hal_common::{ rmt::{PulseCode, TxChannel, TxChannelConfig, TxChannelCreator}, Rmt, }; -use esp_println::println; #[entry] fn main() -> ! { diff --git a/esp32s3-hal/examples/spi_loopback_dma.rs b/esp32s3-hal/examples/spi_loopback_dma.rs index f71b5e21ce8..3e9804c688b 100644 --- a/esp32s3-hal/examples/spi_loopback_dma.rs +++ b/esp32s3-hal/examples/spi_loopback_dma.rs @@ -115,7 +115,7 @@ fn main() -> ! { } // the buffers and spi is moved into the transfer and we can get it back via // `wait` - (receive, send, spi) = transfer.wait(); + (receive, send, spi) = transfer.wait().unwrap(); println!( "{:x?} .. {:x?}", &receive[..10],