diff options
| author | Felipe Balbi <[email protected]> | 2025-12-16 11:27:20 -0800 |
|---|---|---|
| committer | Felipe Balbi <[email protected]> | 2025-12-16 11:33:30 -0800 |
| commit | 2102dba83b3254b77c12a23fd17853cbf985233f (patch) | |
| tree | ffe437de40e46a236d3fe3bfc0b4c2fbfcf9f6f9 /embassy-imxrt/src/flexcomm/uart.rs | |
| parent | 4e3e4f44c29d6a5ef93d646b0ae4acc861f1f72e (diff) | |
[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.
Diffstat (limited to 'embassy-imxrt/src/flexcomm/uart.rs')
| -rw-r--r-- | embassy-imxrt/src/flexcomm/uart.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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> { | |||
| 598 | regs.fifocfg().modify(|_, w| w.dmatx().disabled()); | 598 | regs.fifocfg().modify(|_, w| w.dmatx().disabled()); |
| 599 | }); | 599 | }); |
| 600 | 600 | ||
| 601 | for chunk in buf.chunks(1024) { | 601 | for chunk in buf.chunks(dma::MAX_CHUNK_SIZE) { |
| 602 | regs.fifocfg().modify(|_, w| w.dmatx().enabled()); | 602 | regs.fifocfg().modify(|_, w| w.dmatx().enabled()); |
| 603 | 603 | ||
| 604 | let ch = self.tx_dma.as_mut().unwrap().reborrow(); | 604 | let ch = self.tx_dma.as_mut().unwrap().reborrow(); |
| @@ -726,7 +726,7 @@ impl<'a> UartRx<'a, Async> { | |||
| 726 | regs.fifocfg().modify(|_, w| w.dmarx().disabled()); | 726 | regs.fifocfg().modify(|_, w| w.dmarx().disabled()); |
| 727 | }); | 727 | }); |
| 728 | 728 | ||
| 729 | for chunk in buf.chunks_mut(1024) { | 729 | for chunk in buf.chunks_mut(dma::MAX_CHUNK_SIZE) { |
| 730 | regs.fifocfg().modify(|_, w| w.dmarx().enabled()); | 730 | regs.fifocfg().modify(|_, w| w.dmarx().enabled()); |
| 731 | 731 | ||
| 732 | let ch = self.rx_dma.as_mut().unwrap().reborrow(); | 732 | let ch = self.rx_dma.as_mut().unwrap().reborrow(); |
