From 374a3345e55b858bdea2ef205e5ba800b21ba68c Mon Sep 17 00:00:00 2001 From: liebman Date: Thu, 19 Sep 2024 12:32:43 -0700 Subject: [PATCH] drop block_size from macro, the buffer allocation was not being aligned - its not needed for dram anyway. --- esp-hal/src/dma/mod.rs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/esp-hal/src/dma/mod.rs b/esp-hal/src/dma/mod.rs index f5f2b15d10..ce3950cee0 100644 --- a/esp-hal/src/dma/mod.rs +++ b/esp-hal/src/dma/mod.rs @@ -567,10 +567,8 @@ macro_rules! dma_circular_descriptors_chunk_size { }; } -/// Convenience macro to create a DmaTxBuf from buffer size and optional -/// alignment. The buffer and descriptors are statically allocated used to -/// create the `DmaTxBuf` with the passed alignment. With one ardument, the -/// alignment is set to `None`. +/// Convenience macro to create a DmaTxBuf from buffer size. The buffer and +/// descriptors are statically allocated and used to create the `DmaTxBuf`. /// /// ## Usage /// ```rust,no_run @@ -584,19 +582,15 @@ macro_rules! dma_circular_descriptors_chunk_size { /// ``` #[macro_export] macro_rules! dma_tx_buffer { - ($tx_size:expr, $tx_align:expr) => {{ + ($tx_size:expr) => {{ const TX_DESCRIPTOR_LEN: usize = - $crate::dma::DmaTxBuf::compute_descriptor_count($tx_size, $tx_align); + $crate::dma::DmaTxBuf::compute_descriptor_count($tx_size, None); static mut TX_BUFFER: [u8; $tx_size] = [0u8; $tx_size]; static mut TX_DESCRIPTORS: [$crate::dma::DmaDescriptor; TX_DESCRIPTOR_LEN] = [$crate::dma::DmaDescriptor::EMPTY; TX_DESCRIPTOR_LEN]; let (tx_buffer, tx_descriptors) = unsafe { (&mut TX_BUFFER, &mut TX_DESCRIPTORS) }; - $crate::dma::DmaTxBuf::new_with_block_size(tx_descriptors, tx_buffer, $tx_align) + $crate::dma::DmaTxBuf::new(tx_descriptors, tx_buffer) }}; - - ($tx_size:expr) => { - $crate::dma_tx_buffer!($tx_size, None) - }; } /// DMA Errors