From 13b205ece275ecc8e3f020bd687af62df3f03e34 Mon Sep 17 00:00:00 2001 From: Samuel O'Brien Date: Sun, 12 Jan 2025 20:50:16 -0600 Subject: [PATCH 1/2] rp: Fix time driver hang --- embassy-rp/src/time_driver.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/embassy-rp/src/time_driver.rs b/embassy-rp/src/time_driver.rs index aa5d564e72..5aaca03d7c 100644 --- a/embassy-rp/src/time_driver.rs +++ b/embassy-rp/src/time_driver.rs @@ -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() { @@ -97,8 +100,6 @@ impl TimerDriver { } }); - // clear the irq - TIMER.intr().write(|w| w.set_alarm(n, true)); } fn trigger_alarm(&self, cs: CriticalSection) { From 930af8efb710dd1c81a1002e3a47f6abcfb83ebb Mon Sep 17 00:00:00 2001 From: Samuel O'Brien Date: Sun, 12 Jan 2025 20:56:08 -0600 Subject: [PATCH 2/2] run rustfmt --- embassy-rp/src/time_driver.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/embassy-rp/src/time_driver.rs b/embassy-rp/src/time_driver.rs index 5aaca03d7c..d598287a91 100644 --- a/embassy-rp/src/time_driver.rs +++ b/embassy-rp/src/time_driver.rs @@ -99,7 +99,6 @@ impl TimerDriver { TIMER.alarm(n).write_value(timestamp as u32); } }); - } fn trigger_alarm(&self, cs: CriticalSection) {