2MHz timer was not working on Taranis

This commit is contained in:
Damjan Adamic
2014-12-14 21:48:15 +01:00
parent b781455b61
commit 62ca755d5b
+2 -3
View File
@@ -62,10 +62,9 @@ void init2MhzTimer()
// Now for timer 7 // Now for timer 7
RCC->APB1ENR |= RCC_APB1ENR_TIM7EN ; // Enable clock RCC->APB1ENR |= RCC_APB1ENR_TIM7EN ; // Enable clock
TIM7->PSC = 0 ; // Max speed TIM7->PSC = (PERI1_FREQUENCY * TIMER_MULT_APB1) / 2000000 - 1 ; // 0.5 uS, 2 MHz
TIM7->ARR = (PERI1_FREQUENCY * TIMER_MULT_APB1) / 2000000 - 1 ; // 0.5 uS, 2 MHz TIM7->ARR = 65535;
TIM7->CR2 = 0; TIM7->CR2 = 0;
TIM7->CR2 = 0x20 ;
TIM7->CR1 = TIM_CR1_CEN; TIM7->CR1 = TIM_CR1_CEN;
} }