Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominic Fischer committed Sep 27, 2024
1 parent 2dc05d8 commit 577bdbd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions esp-hal/src/dma/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ macro_rules! dma_tx_buffer {
#[macro_export]
macro_rules! dma_rx_stream_buffer {
($rx_size:expr) => {
dma_rx_stream_buffer!($rx_size, chunk_size = 4095)
$crate::dma_rx_stream_buffer!($rx_size, chunk_size = 4095)
};
($rx_size:expr, $chunk_size:expr) => {{
let (buffer, descriptors) =
Expand Down Expand Up @@ -1625,13 +1625,15 @@ where
&mut self,
first_desc: *mut DmaDescriptor,
peri: DmaPeripheral,
) {
) -> Result<(), DmaError> {
compiler_fence(core::sync::atomic::Ordering::SeqCst);

R::clear_in_interrupts();
R::reset_in();
R::set_in_descriptors(first_desc as u32);
R::set_in_peripheral(peri as u8);

Ok(())
}

fn start_transfer(&mut self) -> Result<(), DmaError> {
Expand Down Expand Up @@ -1719,8 +1721,7 @@ where
}

self.rx_impl
.prepare_transfer_without_start(chain.first() as _, peri);
Ok(())
.prepare_transfer_without_start(chain.first() as _, peri)
}

unsafe fn prepare_transfer<BUF: DmaRxBuffer>(
Expand All @@ -1736,9 +1737,7 @@ where
}

self.rx_impl
.prepare_transfer_without_start(preparation.start, peri);

Ok(())
.prepare_transfer_without_start(preparation.start, peri)
}

fn start_transfer(&mut self) -> Result<(), DmaError> {
Expand Down
2 changes: 1 addition & 1 deletion esp-hal/src/lcd_cam/cam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
//! # let dma = Dma::new(peripherals.DMA);
//! # let channel = dma.channel0;
//!
//! # let dma_buf = dma_rx_stream_buffer!(20 * 1000, chunk_size = 1000);
//! # let dma_buf = dma_rx_stream_buffer!(20 * 1000, 1000);
//!
//! # let channel = channel.configure(
//! # false,
Expand Down

0 comments on commit 577bdbd

Please sign in to comment.