From 678dce33f6c53d0b5ae06677c45dbc8cc68e42db Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 25 Oct 2014 15:29:23 -0600 Subject: [PATCH] Add debug assertion --- arch/arm/src/efm32/efm32_dma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm/src/efm32/efm32_dma.c b/arch/arm/src/efm32/efm32_dma.c index e696923288..5425b58d80 100644 --- a/arch/arm/src/efm32/efm32_dma.c +++ b/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);