1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 12:55:19 +03:00

Removed superfluous timerClockDivisor (not used anywhere anymore).

This commit is contained in:
blckmn 2017-07-09 07:41:02 +10:00
parent 750bc6452a
commit a078739ec2
5 changed files with 8 additions and 31 deletions

View file

@ -80,23 +80,18 @@ const timerDef_t timerDefinitions[HARDWARE_TIMER_DEFINITION_COUNT] = {
7 TIM8_CH1 TIM8_CH2 TIM8_CH3 TIM8_CH4
*/
uint8_t timerClockDivisor(TIM_TypeDef *tim)
uint32_t timerClock(TIM_TypeDef *tim)
{
#if defined (STM32F411xE)
UNUSED(tim);
return 1;
return SystemCoreClock;
#elif defined (STM32F40_41xxx)
if (tim == TIM8) return 1;
#endif
if (tim == TIM1 || tim == TIM9 || tim == TIM10 || tim == TIM11) {
return 1;
if (tim == TIM8 || tim == TIM1 || tim == TIM9 || tim == TIM10 || tim == TIM11) {
return SystemCoreClock;
} else {
return 2;
return SystemCoreClock / 2;
}
}
uint32_t timerClock(TIM_TypeDef *tim)
{
return SystemCoreClock / timerClockDivisor(tim);
#else
#error "No timer clock defined correctly for MCU"
#endif
}