Skip to content

Commit

Permalink
[1/3] DMA Move API: Pull out driver specific state in DMA driver into…
Browse files Browse the repository at this point in the history
… separate structs (#1716)

Co-authored-by: Dominic Fischer <git@dominicfischer.me>
  • Loading branch information
Dominaezzz and Dominic Fischer authored Jun 25, 2024
1 parent 9d5fb31 commit 0b5eb1f
Show file tree
Hide file tree
Showing 3 changed files with 518 additions and 395 deletions.
14 changes: 10 additions & 4 deletions esp-hal/src/dma/gdma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,9 +504,12 @@ macro_rules! impl_channel {
let mut rx_impl = ChannelRxImpl {};
rx_impl.init(burst_mode, priority);

let tx_chain = DescriptorChain::new(tx_descriptors);
let rx_chain = DescriptorChain::new(rx_descriptors);

crate::dma::Channel {
tx: ChannelTx::new(tx_descriptors, tx_impl, burst_mode),
rx: ChannelRx::new(rx_descriptors, rx_impl, burst_mode),
tx: ChannelTx::new(tx_chain, tx_impl, burst_mode),
rx: ChannelRx::new(rx_chain, rx_impl, burst_mode),
phantom: PhantomData,
}
}
Expand All @@ -529,11 +532,14 @@ macro_rules! impl_channel {
let mut rx_impl = ChannelRxImpl {};
rx_impl.init(burst_mode, priority);

let tx_chain = DescriptorChain::new(tx_descriptors);
let rx_chain = DescriptorChain::new(rx_descriptors);

<Channel<$num> as ChannelTypes>::Binder::set_isr($async_handler);

crate::dma::Channel {
tx: ChannelTx::new(tx_descriptors, tx_impl, burst_mode),
rx: ChannelRx::new(rx_descriptors, rx_impl, burst_mode),
tx: ChannelTx::new(tx_chain, tx_impl, burst_mode),
rx: ChannelRx::new(rx_chain, rx_impl, burst_mode),
phantom: PhantomData,
}
}
Expand Down
Loading

0 comments on commit 0b5eb1f

Please sign in to comment.