aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/LLD/DMAv1/stm32_dma.c
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2018-11-02 17:15:38 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2018-11-02 17:15:38 +0000
commit9f6a17e4f1aa9f97f7aab6616cdec231e56e0dd4 (patch)
treeba912bc1227196b1a306977e214be3a4be281efc /os/hal/ports/STM32/LLD/DMAv1/stm32_dma.c
parentda54384531630ae204b1b925537a2ec0bb136980 (diff)
downloadChibiOS-9f6a17e4f1aa9f97f7aab6616cdec231e56e0dd4.tar.gz
ChibiOS-9f6a17e4f1aa9f97f7aab6616cdec231e56e0dd4.tar.bz2
ChibiOS-9f6a17e4f1aa9f97f7aab6616cdec231e56e0dd4.zip
Various fixes to OCTOSPI e DMAv1 and MX25.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12401 110e8d01-0319-4d1e-a829-52ad28d1bb01
Diffstat (limited to 'os/hal/ports/STM32/LLD/DMAv1/stm32_dma.c')
-rw-r--r--os/hal/ports/STM32/LLD/DMAv1/stm32_dma.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/os/hal/ports/STM32/LLD/DMAv1/stm32_dma.c b/os/hal/ports/STM32/LLD/DMAv1/stm32_dma.c
index 03ab81d08..f7b51abd5 100644
--- a/os/hal/ports/STM32/LLD/DMAv1/stm32_dma.c
+++ b/os/hal/ports/STM32/LLD/DMAv1/stm32_dma.c
@@ -545,6 +545,13 @@ bool dmaStreamAllocate(const stm32_dma_stream_t *dmastp,
}
#endif
+#if STM32_DMA_SUPPORTS_DMAMUX == TRUE
+ /* Enabling DMAMUX if present.*/
+ if (dma.streams_mask == 0U) {
+ rccEnableDMAMUX(true);
+ }
+#endif
+
/* Putting the stream in a safe state.*/
dmaStreamDisable(dmastp);
dmastp->channel->CCR = STM32_DMA_CCR_RESET_VALUE;
@@ -607,6 +614,13 @@ void dmaStreamRelease(const stm32_dma_stream_t *dmastp) {
rccDisableDMA2();
}
#endif
+
+#if STM32_DMA_SUPPORTS_DMAMUX == TRUE
+ /* Shutting down DMAMUX if present.*/
+ if (dma.streams_mask == 0U) {
+ rccDisableDMAMUX();
+ }
+#endif
}
#if (STM32_DMA_SUPPORTS_DMAMUX == TRUE) || defined(__DOXYGEN__)