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.
This commit is contained in:
parent
63ca7a211a
commit
dc1ac5dc3a
@ -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);
|
HAL_NVIC_SetPriority(dma_irqn[dma_id], IRQ_PRI_DMA, IRQ_SUBPRI_DMA);
|
||||||
} else {
|
} else {
|
||||||
// only necessary initialization
|
// only necessary initialization
|
||||||
|
dma->State = HAL_DMA_STATE_READY;
|
||||||
#if defined(MCU_SERIES_F4)
|
#if defined(MCU_SERIES_F4)
|
||||||
// calculate DMA base address and bitshift to be used in IRQ handler
|
// calculate DMA base address and bitshift to be used in IRQ handler
|
||||||
extern uint32_t DMA_CalcBaseAndBitshift(DMA_HandleTypeDef *hdma);
|
extern uint32_t DMA_CalcBaseAndBitshift(DMA_HandleTypeDef *hdma);
|
||||||
|
Loading…
Reference in New Issue
Block a user