Skip to content

Commit

Permalink
Fix async PARL_IO RX (esp-rs#1851)
Browse files Browse the repository at this point in the history
* Fix async PARL_IO RX

* CHANGELOG.md
  • Loading branch information
bjoernQ authored Jul 24, 2024
1 parent 3299348 commit 38f1d28
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions esp-hal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions esp-hal/src/parl_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand Down Expand Up @@ -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?;

Expand Down
6 changes: 5 additions & 1 deletion examples/src/bin/embassy_parl_io_rx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 38f1d28

Please sign in to comment.