mirror of
https://github.com/italicsjenga/rp-hal-boards.git
synced 2025-01-11 04:51:31 +11:00
Use new alarm syntax in pico_rtic example
This commit is contained in:
parent
b19f2cc8e5
commit
f51a84f070
|
@ -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());
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue