From f51a84f0701b5fe4b78ee14828feef88d64aaaa7 Mon Sep 17 00:00:00 2001 From: 9names <60134748+9names@users.noreply.github.com> Date: Sun, 30 Jan 2022 23:04:16 +1100 Subject: [PATCH] Use new alarm syntax in pico_rtic example --- boards/rp-pico/examples/pico_rtic.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/boards/rp-pico/examples/pico_rtic.rs b/boards/rp-pico/examples/pico_rtic.rs index 83f172d..721340c 100644 --- a/boards/rp-pico/examples/pico_rtic.rs +++ b/boards/rp-pico/examples/pico_rtic.rs @@ -54,7 +54,7 @@ mod app { let mut timer = hal::Timer::new(c.device.TIMER, &mut resets); let mut alarm = timer.alarm_0().unwrap(); let _ = alarm.schedule(SCAN_TIME_US.microseconds()); - alarm.enable_interrupt(&mut timer); + alarm.enable_interrupt(); (Shared { timer, alarm, led }, Local {}, init::Monotonics()) } @@ -73,10 +73,9 @@ mod app { } *c.local.tog = !*c.local.tog; - let timer = c.shared.timer; - let alarm = c.shared.alarm; - (timer, alarm).lock(|t, a| { - a.clear_interrupt(t); + let mut alarm = c.shared.alarm; + (alarm).lock(|a| { + a.clear_interrupt(); let _ = a.schedule(SCAN_TIME_US.microseconds()); }); }