PPM trainer output: update delay on each cycle

This commit is contained in:
Raphael Coeffic
2022-12-10 13:37:31 +01:00
committed by Raphael Coeffic
parent 2254d04643
commit f881d7e11c
3 changed files with 8 additions and 0 deletions
@@ -183,6 +183,7 @@ static const stm32_pulse_timer_t trainerOutputTimer = {
static void trainerSendNextFrame()
{
stm32_pulse_set_polarity(&trainerOutputTimer, GET_TRAINER_PPM_POLARITY());
stm32_pulse_set_cmp_val(&trainerOutputTimer, GET_TRAINER_PPM_DELAY() * 2);
// load the first period: next reload when CC compare event triggers
trainerPulsesData.ppm.ptr = trainerPulsesData.ppm.pulses;