|
|
@ -98,6 +98,11 @@ static void __attribute__((unused)) tim_isr(struct timer *tm) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
static void __attribute__((unused)) tim_rcc_setup(struct timer *tm) |
|
|
|
{ |
|
|
|
RCC_APB1PeriphClockCmd(tm->rcc, ENABLE); |
|
|
|
} |
|
|
|
|
|
|
|
#if (TARGET_HAS_TIM1) |
|
|
|
static void tim1_setup(struct timer *tm) |
|
|
|
{ |
|
|
@ -120,15 +125,10 @@ void TIM1_UP_TIM10_IRQHandler() |
|
|
|
#endif |
|
|
|
|
|
|
|
#if (TARGET_HAS_TIM2) |
|
|
|
static void tim2_setup(struct timer *tm) |
|
|
|
{ |
|
|
|
RCC_APB1PeriphClockCmd(tm->rcc, ENABLE); |
|
|
|
} |
|
|
|
|
|
|
|
struct timer timer1 = { |
|
|
|
.name = "TIM2", |
|
|
|
.tim = TIM2, |
|
|
|
.setup = tim2_setup, |
|
|
|
.setup = tim_rcc_setup, |
|
|
|
.rcc = RCC_APB1Periph_TIM2, |
|
|
|
.irq = TIM2_IRQn, |
|
|
|
.irq_priority = -1, |
|
|
@ -141,15 +141,10 @@ void TIM2_IRQHandler() |
|
|
|
#endif |
|
|
|
|
|
|
|
#if (TARGET_HAS_TIM3) |
|
|
|
static void tim3_setup(struct timer *tm) |
|
|
|
{ |
|
|
|
RCC_APB1PeriphClockCmd(tm->rcc, ENABLE); |
|
|
|
} |
|
|
|
|
|
|
|
struct timer timer2 = { |
|
|
|
.name = "TIM1", |
|
|
|
.name = "TIM3", |
|
|
|
.tim = TIM3, |
|
|
|
.setup = tim3_setup, |
|
|
|
.setup = tim_rcc_setup, |
|
|
|
.rcc = RCC_APB1Periph_TIM3, |
|
|
|
.irq = TIM3_IRQn, |
|
|
|
.irq_priority = -1, |
|
|
@ -161,3 +156,67 @@ void TIM3_IRQHandler() |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
#if (TARGET_HAS_TIM4) |
|
|
|
struct timer timer3 = { |
|
|
|
.name = "TIM4", |
|
|
|
.tim = TIM4, |
|
|
|
.setup = tim_rcc_setup, |
|
|
|
.rcc = RCC_APB1Periph_TIM4, |
|
|
|
.irq = TIM4_IRQn, |
|
|
|
.irq_priority = -1, |
|
|
|
}; |
|
|
|
|
|
|
|
void TIM4_IRQHandler() |
|
|
|
{ |
|
|
|
tim_isr(&timer3); |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
#if (TARGET_HAS_TIM5) |
|
|
|
struct timer timer4 = { |
|
|
|
.name = "TIM5", |
|
|
|
.tim = TIM5, |
|
|
|
.setup = tim_rcc_setup, |
|
|
|
.rcc = RCC_APB1Periph_TIM5, |
|
|
|
.irq = TIM5_IRQn, |
|
|
|
.irq_priority = -1, |
|
|
|
}; |
|
|
|
|
|
|
|
void TIM5_IRQHandler() |
|
|
|
{ |
|
|
|
tim_isr(&timer4); |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
#if (TARGET_HAS_TIM6) |
|
|
|
struct timer timer5 = { |
|
|
|
.name = "TIM6", |
|
|
|
.tim = TIM6, |
|
|
|
.setup = tim_rcc_setup, |
|
|
|
.rcc = RCC_APB1Periph_TIM6, |
|
|
|
.irq = TIM6_DAC_IRQn, |
|
|
|
.irq_priority = -1, |
|
|
|
}; |
|
|
|
|
|
|
|
void TIM6_DAC_IRQHandler() |
|
|
|
{ |
|
|
|
tim_isr(&timer5); |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
#if (TARGET_HAS_TIM7) |
|
|
|
struct timer timer6 = { |
|
|
|
.name = "TIM7", |
|
|
|
.tim = TIM7, |
|
|
|
.setup = tim_rcc_setup, |
|
|
|
.rcc = RCC_APB1Periph_TIM7, |
|
|
|
.irq = TIM7_IRQn, |
|
|
|
.irq_priority = -1, |
|
|
|
}; |
|
|
|
|
|
|
|
void TIM7_IRQHandler() |
|
|
|
{ |
|
|
|
tim_isr(&timer6); |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|