From 2102dba83b3254b77c12a23fd17853cbf985233f Mon Sep 17 00:00:00 2001 From: Felipe Balbi Date: Tue, 16 Dec 2025 11:27:20 -0800 Subject: [iMXRT] dma: define MAX_CHUNK_SIZE constant Instead of adding magic constants all over the place, let's just define DMA MAX_CHUNK_SIZE in a single constant that be referenced by the various users. --- embassy-imxrt/src/flexcomm/uart.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'embassy-imxrt/src/flexcomm/uart.rs') diff --git a/embassy-imxrt/src/flexcomm/uart.rs b/embassy-imxrt/src/flexcomm/uart.rs index 2b759ba84..d13b32e93 100644 --- a/embassy-imxrt/src/flexcomm/uart.rs +++ b/embassy-imxrt/src/flexcomm/uart.rs @@ -598,7 +598,7 @@ impl<'a> UartTx<'a, Async> { regs.fifocfg().modify(|_, w| w.dmatx().disabled()); }); - for chunk in buf.chunks(1024) { + for chunk in buf.chunks(dma::MAX_CHUNK_SIZE) { regs.fifocfg().modify(|_, w| w.dmatx().enabled()); let ch = self.tx_dma.as_mut().unwrap().reborrow(); @@ -726,7 +726,7 @@ impl<'a> UartRx<'a, Async> { regs.fifocfg().modify(|_, w| w.dmarx().disabled()); }); - for chunk in buf.chunks_mut(1024) { + for chunk in buf.chunks_mut(dma::MAX_CHUNK_SIZE) { regs.fifocfg().modify(|_, w| w.dmarx().enabled()); let ch = self.rx_dma.as_mut().unwrap().reborrow(); -- cgit