Skip to content

Commit 6132b6e

Browse files
committed
stm32/dma: Export DMA handles.
1 parent 9a32daf commit 6132b6e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

ports/stm32/dma.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ static const DMA_InitTypeDef dma_init_struct_dac = {
205205
};
206206
#else
207207
// Default parameters to dma_init() for DAC tx
208-
static const DMA_InitTypeDef dma_init_struct_dac = {
208+
DMA_InitTypeDef dma_init_struct_dac = {
209209
#if defined(STM32F4) || defined(STM32F7)
210210
.Channel = 0,
211211
#elif defined(STM32G0) || defined(STM32G4) || defined(STM32H7) || defined(STM32L0) || defined(STM32L4) || defined(STM32WB) || defined(STM32WL)
@@ -916,7 +916,7 @@ static const uint8_t dma_irqn[NSTREAM] = {
916916
};
917917
#endif
918918

919-
static DMA_HandleTypeDef *dma_handle[NSTREAM] = {NULL};
919+
DMA_HandleTypeDef *dma_handle[NSTREAM] = {NULL};
920920
static uint8_t dma_last_sub_instance[NSTREAM];
921921
static volatile uint32_t dma_enable_mask = 0;
922922
#if MICROPY_HW_DMA_ENABLE_AUTO_TURN_OFF
@@ -1630,6 +1630,7 @@ void dma_init(DMA_HandleTypeDef *dma, const dma_descr_t *dma_descr, uint32_t dir
16301630

16311631
void dma_deinit(const dma_descr_t *dma_descr) {
16321632
if (dma_descr != NULL) {
1633+
HAL_DMA_Abort(dma_handle[dma_descr->id]);
16331634
#if !defined(STM32F0)
16341635
HAL_NVIC_DisableIRQ(dma_irqn[dma_descr->id]);
16351636
#endif

0 commit comments

Comments
 (0)