From 38f1d2858598acf8348f9732c192f448cb7985ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Quentin?= Date: Wed, 24 Jul 2024 15:19:19 +0200 Subject: [PATCH] Fix async PARL_IO RX (#1851) * Fix async PARL_IO RX * CHANGELOG.md --- esp-hal/CHANGELOG.md | 1 + esp-hal/src/parl_io.rs | 4 ++-- examples/src/bin/embassy_parl_io_rx.rs | 6 +++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/esp-hal/CHANGELOG.md b/esp-hal/CHANGELOG.md index 9a2d23ea431..b545a792d8f 100644 --- a/esp-hal/CHANGELOG.md +++ b/esp-hal/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fix I2S async-tx (#1833) +- Fix PARL_IO async-rx (#1851) ### Removed diff --git a/esp-hal/src/parl_io.rs b/esp-hal/src/parl_io.rs index d617a4be379..8f8b185fc2a 100644 --- a/esp-hal/src/parl_io.rs +++ b/esp-hal/src/parl_io.rs @@ -1664,7 +1664,7 @@ pub mod asynch { use super::{private::Instance, Error, ParlIoRx, ParlIoTx, MAX_DMA_SIZE}; use crate::{ - dma::{asynch::DmaRxDoneChFuture, DmaChannel, ParlIoPeripheral}, + dma::{asynch::DmaRxFuture, DmaChannel, ParlIoPeripheral}, peripherals::Interrupt, }; @@ -1756,7 +1756,7 @@ pub mod asynch { return Err(Error::MaxDmaTransferSizeExceeded); } - let future = DmaRxDoneChFuture::new(&mut self.rx_channel); + let future = DmaRxFuture::new(&mut self.rx_channel); Self::start_receive_bytes_dma(future.rx, &mut self.rx_chain, ptr, len)?; future.await?; diff --git a/examples/src/bin/embassy_parl_io_rx.rs b/examples/src/bin/embassy_parl_io_rx.rs index 998338a0881..d1c6ccfe266 100644 --- a/examples/src/bin/embassy_parl_io_rx.rs +++ b/examples/src/bin/embassy_parl_io_rx.rs @@ -74,7 +74,11 @@ async fn main(_spawner: Spawner) { let buffer = rx_buffer; loop { parl_io_rx.read_dma_async(buffer).await.unwrap(); - println!("Received: {:02x?} ...", &buffer[..30]); + println!( + "Received: {:02x?} ... {:02x?}", + &buffer[..30], + &buffer[(buffer.len() - 30)..] + ); Timer::after(Duration::from_millis(500)).await; }