summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Blazewicz <krzysztof.blazewicz@uxeon.com>2016-09-08 12:57:14 +0200
committerKrzysztof Blazewicz <krzysztof.blazewicz@uxeon.com>2016-11-16 12:43:27 +0100
commitdc1ac5dc3ac4bfcf530bf62ada3e050c2566a698 (patch)
treec97ad955516190e2eee7f1290b7eb77caafce91a
parent63ca7a211ac832fb885753ad837a7b3de2aaa5da (diff)
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.
-rw-r--r--stmhal/dma.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/stmhal/dma.c b/stmhal/dma.c
index 60d7b0210..df40cc696 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);