Fix async PARL_IO RX (#1851)

* Fix async PARL_IO RX

* CHANGELOG.md
This commit is contained in:
Björn Quentin 2024-07-24 15:19:19 +02:00 committed by GitHub
parent 3299348ebc
commit 38f1d28585
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 3 deletions

View File

@ -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

View File

@ -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?;

View File

@ -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;
}