From 2e59e3f93cd61a3e24dce01bcf8ba861bb1c358c Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 1 Jun 2014 10:01:27 +0000 Subject: Fixed bug #510. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@6977 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/ports/STM32/STM32F1xx/stm32_dma.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'os/hal/ports/STM32/STM32F1xx') diff --git a/os/hal/ports/STM32/STM32F1xx/stm32_dma.c b/os/hal/ports/STM32/STM32F1xx/stm32_dma.c index c3b39d37c..f6d8c8f49 100644 --- a/os/hal/ports/STM32/STM32F1xx/stm32_dma.c +++ b/os/hal/ports/STM32/STM32F1xx/stm32_dma.c @@ -472,7 +472,18 @@ void dmaStreamRelease(const stm32_dma_stream_t *dmastp) { "not allocated"); /* Disables the associated IRQ vector.*/ +#if !(STM32_HAS_DMA2 && !defined(STM32F10X_CL)) || defined(__DOXYGEN__) nvicDisableVector(dmastp->vector); +#else + /* Check unless it is 10 or 11 stream. If yes, make additional check before + disabling IRQ.*/ + if (dmastp->selfindex < 10) + nvicDisableVector(dmastp->vector); + else { + if (dma_streams_mask & (3 << 10) == 0) + nvicDisableVector(dmastp->vector); + } +#endif/* STM32_HAS_DMA2 && !STM32F10X_CL */ /* Marks the stream as not allocated.*/ dma_streams_mask &= ~(1 << dmastp->selfindex); -- cgit v1.2.3