1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 21:05:35 +03:00

Simplified getting timerClock

This commit is contained in:
blckmn 2017-05-11 13:16:58 +10:00
parent 681b5e79b6
commit 0d13736e2f
8 changed files with 35 additions and 4 deletions

View file

@ -91,3 +91,15 @@ uint8_t timerClockDivisor(TIM_TypeDef *tim)
return 2;
}
}
uint32_t timerClock(TIM_TypeDef *tim)
{
#if defined (STM32F40_41xxx)
if (tim == TIM8) return SystemCoreClock;
#endif
if (tim == TIM1 || tim == TIM9 || tim == TIM10 || tim == TIM11) {
return SystemCoreClock;
} else {
return SystemCoreClock / 2;
}
}