Skip to content

Commit

Permalink
Keep DMA initialised on PPM driver
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelcoeffic committed Sep 3, 2023
1 parent 57f7189 commit a25526b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions radio/src/targets/common/arm/stm32/module_timer_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ static void module_timer_send(void* ctx, const etx_timer_config_t* cfg,
const void* pulses, uint16_t length)
{
auto timer = (const stm32_pulse_timer_t*)ctx;
if (!stm32_pulse_if_not_running_disable(timer)) {
LL_DMA_DeInit(timer->DMAx, timer->DMA_Stream);
if (!stm32_pulse_if_not_running_disable(timer))
return;
}

// Set polarity
stm32_pulse_set_polarity(timer, cfg->polarity);
Expand Down
4 changes: 1 addition & 3 deletions radio/src/targets/common/arm/stm32/stm32_pulse_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ static void init_dma_arr_mode(const stm32_pulse_timer_t* tim)
dmaInit.Channel = tim->DMA_Channel;
dmaInit.Priority = LL_DMA_PRIORITY_VERYHIGH;

stm32_dma_enable_clock(tim->DMAx);
LL_DMA_Init(tim->DMAx, tim->DMA_Stream, &dmaInit);
}

Expand Down Expand Up @@ -311,9 +312,6 @@ void stm32_pulse_start_dma_req(const stm32_pulse_timer_t* tim,
LL_TIM_EnableDMAReq_UPDATE(tim->TIMx);
LL_DMA_EnableStream(tim->DMAx, tim->DMA_Stream);

// Trigger update to effect the first DMA transaction
// and thus load ARR with the first duration

// start timer
LL_TIM_EnableCounter(tim->TIMx);
}
Expand Down

0 comments on commit a25526b

Please sign in to comment.