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:
parent
681b5e79b6
commit
0d13736e2f
8 changed files with 35 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue