diff --git a/esp-hal/src/timer/systimer.rs b/esp-hal/src/timer/systimer.rs index 9506a1e3bdf..48838889dc0 100644 --- a/esp-hal/src/timer/systimer.rs +++ b/esp-hal/src/timer/systimer.rs @@ -887,7 +887,7 @@ mod asynch { } impl<'a, const COMP: u8, const UNIT: u8> AlarmFuture<'a, COMP, UNIT> { - pub(crate) fn new(alarm: &'a Alarm) -> Self { + pub(crate) fn new(alarm: &'a Alarm<'a, Periodic, crate::Async, COMP, UNIT>) -> Self { alarm.clear_interrupt(); let (interrupt, handler) = match COMP { diff --git a/hil-test/tests/embassy_timers_executors.rs b/hil-test/tests/embassy_timers_executors.rs index c5cd4861bc5..b3950a6251d 100644 --- a/hil-test/tests/embassy_timers_executors.rs +++ b/hil-test/tests/embassy_timers_executors.rs @@ -148,7 +148,7 @@ mod test_helpers { let system = SystemControl::new(peripherals.SYSTEM); let clocks = ClockControl::boot_defaults(system.clock_control).freeze(); - let systimer = SystemTimer::new(peripherals.SYSTIMER); + let systimer = SystemTimer::new(peripherals.SYSTIMER).split(); let alarm0: ErasedTimer = systimer.alarm0.into(); let timers = [OneShotTimer::new(alarm0)]; let timers = mk_static!([OneShotTimer; 1], timers); @@ -189,7 +189,7 @@ mod test_helpers { let system = SystemControl::new(peripherals.SYSTEM); let clocks = ClockControl::boot_defaults(system.clock_control).freeze(); - let systimer = SystemTimer::new(peripherals.SYSTIMER); + let systimer = SystemTimer::new(peripherals.SYSTIMER).split(); let alarm0: ErasedTimer = systimer.alarm0.into(); let timers = [OneShotTimer::new(alarm0)]; let timers = mk_static!([OneShotTimer; 1], timers); @@ -322,7 +322,7 @@ mod test { fn run_test_periodic_systimer() { let peripherals = Peripherals::take(); - let systimer = SystemTimer::new(peripherals.SYSTIMER); + let systimer = SystemTimer::new(peripherals.SYSTIMER).split(); let mut periodic = PeriodicTimer::new(systimer.alarm0); @@ -382,7 +382,7 @@ mod test { fn run_test_periodic_oneshot_systimer() { let mut peripherals = Peripherals::take(); - let mut systimer = SystemTimer::new(&mut peripherals.SYSTIMER); + let mut systimer = SystemTimer::new(&mut peripherals.SYSTIMER).split(); let mut periodic = PeriodicTimer::new(&mut systimer.alarm0); @@ -400,7 +400,7 @@ mod test { core::mem::drop(periodic); - let systimer = SystemTimer::new(&mut peripherals.SYSTIMER); + let systimer = SystemTimer::new(&mut peripherals.SYSTIMER).split(); let timer0 = OneShotTimer::new(systimer.alarm0); @@ -448,7 +448,7 @@ mod test { let timer0 = OneShotTimer::new(timer0); let timer1 = { - let systimer = esp_hal::timer::systimer::SystemTimer::new(peripherals.SYSTIMER); + let systimer = esp_hal::timer::systimer::SystemTimer::new(peripherals.SYSTIMER).split(); let alarm0: ErasedTimer = systimer.alarm0.into(); OneShotTimer::new(alarm0) };