Skip to content

Commit 13b205e

Browse files
committed
rp: Fix time driver hang
1 parent dd4f576 commit 13b205e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

embassy-rp/src/time_driver.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ impl TimerDriver {
8686
fn check_alarm(&self) {
8787
let n = 0;
8888
critical_section::with(|cs| {
89+
// clear the irq
90+
TIMER.intr().write(|w| w.set_alarm(n, true));
91+
8992
let alarm = &self.alarms.borrow(cs);
9093
let timestamp = alarm.timestamp.get();
9194
if timestamp <= self.now() {
@@ -97,8 +100,6 @@ impl TimerDriver {
97100
}
98101
});
99102

100-
// clear the irq
101-
TIMER.intr().write(|w| w.set_alarm(n, true));
102103
}
103104

104105
fn trigger_alarm(&self, cs: CriticalSection) {

0 commit comments

Comments
 (0)