aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-01-21 13:43:33 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-01-21 13:43:33 +0000
commitc3e9fad51e566a6a3349e152bfb93d3d2a481732 (patch)
tree04f3f0113f36548d16dbb9dfce72a33ebd9dfe1b /os/hal
parent6186d5a390211c9e05cffdd2dab6dcc3b43fdab3 (diff)
downloadChibiOS-c3e9fad51e566a6a3349e152bfb93d3d2a481732.tar.gz
ChibiOS-c3e9fad51e566a6a3349e152bfb93d3d2a481732.tar.bz2
ChibiOS-c3e9fad51e566a6a3349e152bfb93d3d2a481732.zip
Proper DMA stop after copy operation finished.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3842 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal')
-rw-r--r--os/hal/platforms/STM32F1xx/stm32_dma.h7
-rw-r--r--os/hal/platforms/STM32L1xx/stm32_dma.h6
2 files changed, 9 insertions, 4 deletions
diff --git a/os/hal/platforms/STM32F1xx/stm32_dma.h b/os/hal/platforms/STM32F1xx/stm32_dma.h
index 88d8c83bf..e8fd01c33 100644
--- a/os/hal/platforms/STM32F1xx/stm32_dma.h
+++ b/os/hal/platforms/STM32F1xx/stm32_dma.h
@@ -364,8 +364,11 @@ typedef void (*stm32_dmaisr_t)(void *p, uint32_t flags);
* @param[in] dmastp pointer to a stm32_dma_stream_t structure
*/
#define dmaWaitCompletion(dmastp) \
- while (((dmastp)->channel->CNDTR > 0) && \
- ((dmastp)->channel->CCR & STM32_DMA_CR_EN))
+ while ((dmastp)->channel->CNDTR > 0) \
+ ; \
+ dmaStreamDisable(dmastp); \
+}
+
/** @} */
/*===========================================================================*/
diff --git a/os/hal/platforms/STM32L1xx/stm32_dma.h b/os/hal/platforms/STM32L1xx/stm32_dma.h
index 597cce763..a3d94ace2 100644
--- a/os/hal/platforms/STM32L1xx/stm32_dma.h
+++ b/os/hal/platforms/STM32L1xx/stm32_dma.h
@@ -355,8 +355,10 @@ typedef void (*stm32_dmaisr_t)(void *p, uint32_t flags);
* @param[in] dmastp pointer to a stm32_dma_stream_t structure
*/
#define dmaWaitCompletion(dmastp) \
- while (((dmastp)->channel->CNDTR > 0) && \
- ((dmastp)->channel->CCR & STM32_DMA_CR_EN))
+ while ((dmastp)->channel->CNDTR > 0) \
+ ; \
+ dmaStreamDisable(dmastp); \
+}
/** @} */
/*===========================================================================*/