diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-01-21 08:58:43 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-01-21 08:58:43 +0000 |
commit | 09d8ca4bc084a543b0d64c75f7d75e809f76e515 (patch) | |
tree | eebf9f736f649370bcb3a2635b75556cc5405a77 /os/hal | |
parent | 3fc915ec64be41aed2d18255aa9fa382ec824dbf (diff) | |
download | ChibiOS-09d8ca4bc084a543b0d64c75f7d75e809f76e515.tar.gz ChibiOS-09d8ca4bc084a543b0d64c75f7d75e809f76e515.tar.bz2 ChibiOS-09d8ca4bc084a543b0d64c75f7d75e809f76e515.zip |
Fixed small problem with DMA memory copy, the stream was not properly stopped.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3834 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal')
-rw-r--r-- | os/hal/platforms/STM32F2xx/stm32_dma.h | 12 | ||||
-rw-r--r-- | os/hal/platforms/STM32F4xx/stm32_dma.h | 8 |
2 files changed, 12 insertions, 8 deletions
diff --git a/os/hal/platforms/STM32F2xx/stm32_dma.h b/os/hal/platforms/STM32F2xx/stm32_dma.h index 8f03a64a7..4b349ea1b 100644 --- a/os/hal/platforms/STM32F2xx/stm32_dma.h +++ b/os/hal/platforms/STM32F2xx/stm32_dma.h @@ -148,7 +148,7 @@ /** @} */
/**
- * @name CR register constants only found in STM32F2xx/STM32F2xx
+ * @name CR register constants only found in STM32F2xx/STM32F4xx
* @{
*/
#define STM32_DMA_CR_DMEIE DMA_SxCR_DMEIE
@@ -171,7 +171,7 @@ /** @} */
/**
- * @name FCR register constants only found in STM32F2xx/STM32F2xx
+ * @name FCR register constants only found in STM32F2xx/STM32F4xx
* @{
*/
#define STM32_DMA_FCR_FEIE DMA_SxFCR_FEIE
@@ -418,9 +418,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)->stream->CNDTR > 0) && \
- ((dmastp)->stream->CCR & STM32_DMA_CR_EN))
+#define dmaWaitCompletion(dmastp) { \
+ while ((dmastp)->stream->NDTR > 0) \
+ ; \
+ dmaStreamDisable(dmastp); \
+}
/** @} */
/*===========================================================================*/
diff --git a/os/hal/platforms/STM32F4xx/stm32_dma.h b/os/hal/platforms/STM32F4xx/stm32_dma.h index 967934a78..8ec1e3aa8 100644 --- a/os/hal/platforms/STM32F4xx/stm32_dma.h +++ b/os/hal/platforms/STM32F4xx/stm32_dma.h @@ -418,9 +418,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)->stream->CNDTR > 0) && \
- ((dmastp)->stream->CCR & STM32_DMA_CR_EN))
+#define dmaWaitCompletion(dmastp) { \
+ while ((dmastp)->stream->NDTR > 0) \
+ ; \
+ dmaStreamDisable(dmastp); \
+}
/** @} */
/*===========================================================================*/
|