stm32: add tim4, tim5 support for time-driver (stm32f410 doesn't have tim2, tim3)
This commit is contained in:
@ -22,6 +22,10 @@ const ALARM_COUNT: usize = 3;
|
||||
type T = peripherals::TIM2;
|
||||
#[cfg(time_driver_tim3)]
|
||||
type T = peripherals::TIM3;
|
||||
#[cfg(time_driver_tim4)]
|
||||
type T = peripherals::TIM4;
|
||||
#[cfg(time_driver_tim5)]
|
||||
type T = peripherals::TIM5;
|
||||
|
||||
#[cfg(time_driver_tim2)]
|
||||
#[interrupt]
|
||||
@ -33,6 +37,16 @@ fn TIM2() {
|
||||
fn TIM3() {
|
||||
DRIVER.on_interrupt()
|
||||
}
|
||||
#[cfg(time_driver_tim4)]
|
||||
#[interrupt]
|
||||
fn TIM4() {
|
||||
DRIVER.on_interrupt()
|
||||
}
|
||||
#[cfg(time_driver_tim5)]
|
||||
#[interrupt]
|
||||
fn TIM5() {
|
||||
DRIVER.on_interrupt()
|
||||
}
|
||||
|
||||
// Clock timekeeping works with something we call "periods", which are time intervals
|
||||
// of 2^15 ticks. The Clock counter value is 16 bits, so one "overflow cycle" is 2 periods.
|
||||
|
Reference in New Issue
Block a user