diff --git a/main.c b/main.c index b646fc9..e0cd9a0 100644 --- a/main.c +++ b/main.c @@ -56,7 +56,12 @@ void risingEdgeInterruptPinA1() void interruptLEDtoggleOnTIM1counterCompare() { //timerInitCounter(timer_2, 0xFFFF, 0, upCounting); + + // reset timer 2 periperal + RCC->APB1RSTR |= RCC_APB1RSTR_TIM2RST; + // enable timer 2 peripheral + RCC->APB1ENR |= RCC_APB1ENR_TIM2EN; // setclock division to 4 TIM2->CR1 |= TIM_CR1_CKD;