aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/STM32F1xx
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/ports/STM32/STM32F1xx')
-rw-r--r--os/hal/ports/STM32/STM32F1xx/stm32_dma.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/os/hal/ports/STM32/STM32F1xx/stm32_dma.c b/os/hal/ports/STM32/STM32F1xx/stm32_dma.c
index f6d8c8f49..63e7c0778 100644
--- a/os/hal/ports/STM32/STM32F1xx/stm32_dma.c
+++ b/os/hal/ports/STM32/STM32F1xx/stm32_dma.c
@@ -471,6 +471,9 @@ void dmaStreamRelease(const stm32_dma_stream_t *dmastp) {
osalDbgAssert((dma_streams_mask & (1 << dmastp->selfindex)) != 0,
"not allocated");
+ /* Marks the stream as not allocated.*/
+ dma_streams_mask &= ~(1 << dmastp->selfindex);
+
/* Disables the associated IRQ vector.*/
#if !(STM32_HAS_DMA2 && !defined(STM32F10X_CL)) || defined(__DOXYGEN__)
nvicDisableVector(dmastp->vector);
@@ -485,9 +488,6 @@ void dmaStreamRelease(const stm32_dma_stream_t *dmastp) {
}
#endif/* STM32_HAS_DMA2 && !STM32F10X_CL */
- /* Marks the stream as not allocated.*/
- dma_streams_mask &= ~(1 << dmastp->selfindex);
-
/* Shutting down clocks that are no more required, if any.*/
if ((dma_streams_mask & STM32_DMA1_STREAMS_MASK) == 0)
rccDisableDMA1(FALSE);