From 03801bd5e6f645a1463edb8b0d5d12cda6c2ec9e Mon Sep 17 00:00:00 2001 From: polymurph Date: Sun, 23 Oct 2022 11:38:50 +0200 Subject: [PATCH] added missing RCC enable... still not working --- main.c | 5 +++++ 1 file changed, 5 insertions(+) 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;