From 4c76bcedf53a76c634f7729d882195845f938c12 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Wed, 16 Dec 2015 14:59:57 +0000 Subject: SDMMC1 now compilable on STM32L4. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8611 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/ports/STM32/LLD/DMAv2/stm32_dma.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'os/hal/ports/STM32/LLD/DMAv2') diff --git a/os/hal/ports/STM32/LLD/DMAv2/stm32_dma.h b/os/hal/ports/STM32/LLD/DMAv2/stm32_dma.h index 7f7b5a1dc..d2053ad0e 100644 --- a/os/hal/ports/STM32/LLD/DMAv2/stm32_dma.h +++ b/os/hal/ports/STM32/LLD/DMAv2/stm32_dma.h @@ -29,9 +29,16 @@ /* Driver constants. */ /*===========================================================================*/ +/** + * @brief DMA capability. + * @details if @p TRUE then the DMA is able of burst transfers, FIFOs, + * scatter gather and other advanced features. + */ +#define STM32_DMA_ADVANCED TRUE + /** * @brief Total number of DMA streams. - * @note This is the total number of streams among all the DMA units. + * @details This is the total number of streams among all the DMA units. */ #define STM32_DMA_STREAMS 16U @@ -635,9 +642,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->NDTR > 0U) \ + (dmastp)->stream->CR &= ~(STM32_DMA_CR_TCIE | STM32_DMA_CR_HTIE | \ + STM32_DMA_CR_TEIE | STM32_DMA_CR_DMEIE); \ + while ((dmastp)->stream->CR & STM32_DMA_CR_EN) \ ; \ - dmaStreamDisable(dmastp); \ + dmaStreamClearInterrupt(dmastp); \ } /** @} */ -- cgit v1.2.3