fix: signal polarity for soft-serial & timer based protocols (#3513)

* fix: signal polarity for soft-serial & timer based protocols

* fix: first PWM period after init
This commit is contained in:
Raphael Coeffic
2023-05-05 19:20:29 +10:00
committed by GitHub
parent f5c1a93f87
commit 6aa1fc90c4
5 changed files with 5 additions and 10 deletions
@@ -28,7 +28,7 @@ static void* module_timer_init(void* hw_def, const etx_timer_config_t* cfg)
bool polarity = cfg->polarity;
uint32_t ocval = cfg->cmp_val;
uint32_t ocmode = (cfg->type == ETX_PWM) ? LL_TIM_OCMODE_PWM1 : LL_TIM_OCMODE_TOGGLE;
uint32_t ocmode = (cfg->type == ETX_PWM) ? LL_TIM_OCMODE_FORCED_INACTIVE : LL_TIM_OCMODE_TOGGLE;
stm32_pulse_init(timer, 0);
stm32_pulse_config_output(timer, polarity, ocmode, ocval);