summaryrefslogtreecommitdiff
path: root/nuttx/arch
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/arch')
-rw-r--r--nuttx/arch/arm/src/efm32/efm32_dma.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/nuttx/arch/arm/src/efm32/efm32_dma.c b/nuttx/arch/arm/src/efm32/efm32_dma.c
index e69692328..5425b58d8 100644
--- a/nuttx/arch/arm/src/efm32/efm32_dma.c
+++ b/nuttx/arch/arm/src/efm32/efm32_dma.c
@@ -488,6 +488,7 @@ void efm32_rxdmasetup(DMA_HANDLE handle, uintptr_t paddr, uintptr_t maddr,
/* Set the number of transfers (minus 1) */
+ DEBUGASSERT((nbytes >> shift) < 1024);
regval |= ((nbytes >> shift) - 1) << _DMA_CTRL_N_MINUS_1_SHIFT;
desc->ctrl = regval;
desc->user = 0;
@@ -573,6 +574,7 @@ void efm32_txdmasetup(DMA_HANDLE handle, uintptr_t paddr, uintptr_t maddr,
/* Set the number of transfers (minus 1) */
+ DEBUGASSERT((nbytes >> shift) < 1024);
regval |= ((nbytes >> shift) - 1) << _DMA_CTRL_N_MINUS_1_SHIFT;
desc->ctrl = regval;
desc->user = 0;
@@ -630,7 +632,7 @@ void efm32_dmastart(DMA_HANDLE handle, dma_callback_t callback, void *arg)
putreg32(bit, EFM32_DMA_CHREQMASKS);
}
- /* Use the primary data structure for channel 0 */
+ /* Use the primary data structure for the channel */
putreg32(bit, EFM32_DMA_CHALTC);