fix: Various mostly X10E soft serial issues (#3382)

* fix: pulse driver with 32bit timers

* fix(mpm): clear RX buffer before signature

* fix: add some debouncing on soft-serial start bit detection

This helps coping with spurious impulses on S.PORT created by payload sent over PPM pin (X10E).

* fix: whenever the RXNE bit is set, read the register

... regardless of errors. That allows for reducing the effect of detected errors.
This commit is contained in:
Raphael Coeffic
2023-03-26 11:23:32 +10:00
committed by GitHub
parent 8560c1f6bf
commit e016598b56
4 changed files with 21 additions and 7 deletions
@@ -70,7 +70,11 @@ void stm32_pulse_init(const stm32_pulse_timer_t* tim, uint32_t freq)
}
timInit.Prescaler = __LL_TIM_CALC_PSC(tim->TIM_Freq, freq);
timInit.Autoreload = STM32_DEFAULT_TIMER_AUTORELOAD;
if (IS_TIM_32B_COUNTER_INSTANCE(tim->TIMx)) {
timInit.Autoreload = 0xFFFFFFFFUL;
} else {
timInit.Autoreload = STM32_DEFAULT_TIMER_AUTORELOAD;
}
enable_tim_clock(tim->TIMx);
LL_TIM_Init(tim->TIMx, &timInit);