Skip to content

Commit dc1ac5d

Browse files
author
Krzysztof Blazewicz
committed
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.
1 parent 63ca7a2 commit dc1ac5d

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

stmhal/dma.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,7 @@ void dma_init(DMA_HandleTypeDef *dma, const dma_descr_t *dma_descr, void *data){
436436
HAL_NVIC_SetPriority(dma_irqn[dma_id], IRQ_PRI_DMA, IRQ_SUBPRI_DMA);
437437
} else {
438438
// only necessary initialization
439+
dma->State = HAL_DMA_STATE_READY;
439440
#if defined(MCU_SERIES_F4)
440441
// calculate DMA base address and bitshift to be used in IRQ handler
441442
extern uint32_t DMA_CalcBaseAndBitshift(DMA_HandleTypeDef *hdma);

0 commit comments

Comments
 (0)