fix: Missing first channel in PPM stream (#3598)
This commit is contained in:
@@ -46,7 +46,10 @@ static void module_timer_send(void* ctx, const etx_timer_config_t* cfg,
|
|||||||
const void* pulses, uint16_t length)
|
const void* pulses, uint16_t length)
|
||||||
{
|
{
|
||||||
auto timer = (const stm32_pulse_timer_t*)ctx;
|
auto timer = (const stm32_pulse_timer_t*)ctx;
|
||||||
if (!stm32_pulse_if_not_running_disable(timer)) return;
|
if (!stm32_pulse_if_not_running_disable(timer)) {
|
||||||
|
LL_DMA_DeInit(timer->DMAx, timer->DMA_Stream);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Set polarity
|
// Set polarity
|
||||||
stm32_pulse_set_polarity(timer, cfg->polarity);
|
stm32_pulse_set_polarity(timer, cfg->polarity);
|
||||||
|
|||||||
@@ -298,12 +298,12 @@ void stm32_pulse_start_dma_req(const stm32_pulse_timer_t* tim,
|
|||||||
// Enable TC IRQ
|
// Enable TC IRQ
|
||||||
LL_DMA_EnableIT_TC(tim->DMAx, tim->DMA_Stream);
|
LL_DMA_EnableIT_TC(tim->DMAx, tim->DMA_Stream);
|
||||||
|
|
||||||
// Reset counter close to overflow
|
// Reset counter
|
||||||
if (IS_TIM_32B_COUNTER_INSTANCE(tim->TIMx)) {
|
LL_TIM_SetCounter(tim->TIMx, 0x00);
|
||||||
LL_TIM_SetCounter(tim->TIMx, 0xFFFFFFFF);
|
|
||||||
} else {
|
// only on PWM (preloads the first period)
|
||||||
LL_TIM_SetCounter(tim->TIMx, 0xFFFF);
|
if (ocmode == LL_TIM_OCMODE_PWM1)
|
||||||
}
|
LL_TIM_GenerateEvent_UPDATE(tim->TIMx);
|
||||||
|
|
||||||
LL_TIM_EnableDMAReq_UPDATE(tim->TIMx);
|
LL_TIM_EnableDMAReq_UPDATE(tim->TIMx);
|
||||||
LL_DMA_EnableStream(tim->DMAx, tim->DMA_Stream);
|
LL_DMA_EnableStream(tim->DMAx, tim->DMA_Stream);
|
||||||
|
|||||||
Reference in New Issue
Block a user