Skip to content

Commit

Permalink
rp: Fix time driver hang
Browse files Browse the repository at this point in the history
  • Loading branch information
robot-rover committed Jan 13, 2025
1 parent dd4f576 commit 13b205e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions embassy-rp/src/time_driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -97,8 +100,6 @@ impl TimerDriver {
}
});

// clear the irq
TIMER.intr().write(|w| w.set_alarm(n, true));
}

fn trigger_alarm(&self, cs: CriticalSection) {
Expand Down

0 comments on commit 13b205e

Please sign in to comment.