Merge pull request #3763 from robot-rover/fix_rp2040_time_driver

rp: Fix time driver hang
This commit is contained in:
Dario Nieuwenhuis 2025-02-04 23:56:43 +00:00 committed by GitHub
commit fdb9795d6a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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) {