This commit is contained in:
Bertrand Songis
2019-09-07 20:19:00 +02:00
parent 6aaf0b5927
commit 5d0708c799
+1 -1
View File
@@ -177,7 +177,7 @@ void extmoduleSerialStart(uint32_t /*baudrate*/, uint32_t period_half_us, bool i
#endif
EXTMODULE_TIMER->ARR = period_half_us;
EXTMODULE_TIMER->CCR2 = 40000; // The first frame will be sent in 20ms
EXTMODULE_TIMER->CCR2 = period_half_us - 4000;
EXTMODULE_TIMER->SR &= ~TIM_SR_CC2IF; // Clear flag
EXTMODULE_TIMER->DIER |= TIM_DIER_UDE | TIM_DIER_CC2IE;
EXTMODULE_TIMER->CR1 |= TIM_CR1_CEN;