Merge pull request #3763 from robot-rover/fix_rp2040_time_driver
rp: Fix time driver hang
This commit is contained in:
commit
fdb9795d6a
@ -86,6 +86,9 @@ impl TimerDriver {
|
||||
fn check_alarm(&self) {
|
||||
let n = 0;
|
||||
critical_section::with(|cs| {
|
||||
// clear the irq
|
||||
TIMER.intr().write(|w| w.set_alarm(n, true));
|
||||
|
||||
let alarm = &self.alarms.borrow(cs);
|
||||
let timestamp = alarm.timestamp.get();
|
||||
if timestamp <= self.now() {
|
||||
@ -96,9 +99,6 @@ impl TimerDriver {
|
||||
TIMER.alarm(n).write_value(timestamp as u32);
|
||||
}
|
||||
});
|
||||
|
||||
// clear the irq
|
||||
TIMER.intr().write(|w| w.set_alarm(n, true));
|
||||
}
|
||||
|
||||
fn trigger_alarm(&self, cs: CriticalSection) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user