Skip to content

Commit

Permalink
Merge pull request #3763 from robot-rover/fix_rp2040_time_driver
Browse files Browse the repository at this point in the history
rp: Fix time driver hang
  • Loading branch information
Dirbaio authored Feb 4, 2025
2 parents f663f3b + 930af8e commit fdb9795
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 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 @@ -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) {
Expand Down

0 comments on commit fdb9795

Please sign in to comment.