From dc1ac5dc3ac4bfcf530bf62ada3e050c2566a698 Mon Sep 17 00:00:00 2001 From: Krzysztof Blazewicz Date: Thu, 8 Sep 2016 12:57:14 +0200 Subject: [PATCH] stmhal/dma: mark DMA sate as READY even if HAL_DMA_Init is skipped Current version of HAL drivers checks if `hdma->State == HAL_DMA_STATE_READY` before executing some functions. --- stmhal/dma.c | 1 + 1 file changed, 1 insertion(+) diff --git a/stmhal/dma.c b/stmhal/dma.c index 60d7b0210c..df40cc696d 100644 --- a/stmhal/dma.c +++ b/stmhal/dma.c @@ -436,6 +436,7 @@ void dma_init(DMA_HandleTypeDef *dma, const dma_descr_t *dma_descr, void *data){ HAL_NVIC_SetPriority(dma_irqn[dma_id], IRQ_PRI_DMA, IRQ_SUBPRI_DMA); } else { // only necessary initialization + dma->State = HAL_DMA_STATE_READY; #if defined(MCU_SERIES_F4) // calculate DMA base address and bitshift to be used in IRQ handler extern uint32_t DMA_CalcBaseAndBitshift(DMA_HandleTypeDef *hdma);