Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/drivers/timer_impl_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@ static void impl_timerDMA_IRQHandler(DMA_t descriptor)
tch->dmaState = TCH_DMA_IDLE;
}

LL_DMA_DisableStream(tch->dma->dma, lookupDMALLStreamTable[DMATAG_GET_STREAM(tch->timHw->dmaTag)]);
LL_TIM_DisableDMAReq_CCx(tch->timHw->tim, lookupDMASourceTable[tch->timHw->channelIndex]);
LL_DMA_DisableStream(tch->dma->dma, lookupDMALLStreamTable[DMATAG_GET_STREAM(tch->timHw->dmaTag)]);

DMA_CLEAR_FLAG(descriptor, DMA_IT_TCIF);
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/drivers/timer_impl_stdperiph.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ static void impl_timerDMA_IRQHandler(DMA_t descriptor)

tch->dmaState = TCH_DMA_IDLE;

DMA_Cmd(tch->dma->ref, DISABLE);
TIM_DMACmd(tch->timHw->tim, lookupDMASourceTable[tch->timHw->channelIndex], DISABLE);
DMA_Cmd(tch->dma->ref, DISABLE);

DMA_CLEAR_FLAG(descriptor, DMA_IT_TCIF);
}
Expand Down Expand Up @@ -518,8 +518,8 @@ void impl_timerPWMPrepareDMA(TCH_t * tch, uint32_t dmaBufferElementCount)
// Clear the flag as well, so even if DMA transfer finishes while within ATOMIC_BLOCK
// the resulting IRQ won't mess up the DMA state
ATOMIC_BLOCK(NVIC_PRIO_MAX) {
DMA_Cmd(tch->dma->ref, DISABLE);
TIM_DMACmd(tch->timHw->tim, lookupDMASourceTable[tch->timHw->channelIndex], DISABLE);
DMA_Cmd(tch->dma->ref, DISABLE);
DMA_CLEAR_FLAG(tch->dma, DMA_IT_TCIF);
}

Expand Down Expand Up @@ -561,8 +561,8 @@ void impl_timerPWMStartDMA(TCH_t * tch)

void impl_timerPWMStopDMA(TCH_t * tch)
{
DMA_Cmd(tch->dma->ref, DISABLE);
TIM_DMACmd(tch->timHw->tim, lookupDMASourceTable[tch->timHw->channelIndex], DISABLE);
DMA_Cmd(tch->dma->ref, DISABLE);
tch->dmaState = TCH_DMA_IDLE;
TIM_Cmd(tch->timHw->tim, ENABLE);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/drivers/timer_impl_stdperiph_at32.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,8 @@ void impl_timerPWMStartDMA(TCH_t * tch)

void impl_timerPWMStopDMA(TCH_t * tch)
{
dma_channel_enable(tch->dma->ref,FALSE);
tmr_dma_request_enable(tch->timHw->tim, lookupDMASourceTable[tch->timHw->channelIndex], FALSE);
dma_channel_enable(tch->dma->ref,FALSE);
tch->dmaState = TCH_DMA_IDLE;
tmr_counter_enable(tch->timHw->tim, TRUE);
}
Expand Down
Loading