diff options
| author | Dario Nieuwenhuis <[email protected]> | 2025-02-04 23:56:43 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-02-04 23:56:43 +0000 |
| commit | fdb9795d6acba52cb023e54e2eb409ad78bdb451 (patch) | |
| tree | a26a18b31a064948e1a7a45a8012faf288b63125 | |
| parent | f663f3b67571abfecbcb642e7e8411dd8f30dc65 (diff) | |
| parent | 930af8efb710dd1c81a1002e3a47f6abcfb83ebb (diff) | |
Merge pull request #3763 from robot-rover/fix_rp2040_time_driver
rp: Fix time driver hang
| -rw-r--r-- | embassy-rp/src/time_driver.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/embassy-rp/src/time_driver.rs b/embassy-rp/src/time_driver.rs index aa5d564e7..d598287a9 100644 --- a/embassy-rp/src/time_driver.rs +++ b/embassy-rp/src/time_driver.rs | |||
| @@ -86,6 +86,9 @@ impl TimerDriver { | |||
| 86 | fn check_alarm(&self) { | 86 | fn check_alarm(&self) { |
| 87 | let n = 0; | 87 | let n = 0; |
| 88 | critical_section::with(|cs| { | 88 | critical_section::with(|cs| { |
| 89 | // clear the irq | ||
| 90 | TIMER.intr().write(|w| w.set_alarm(n, true)); | ||
| 91 | |||
| 89 | let alarm = &self.alarms.borrow(cs); | 92 | let alarm = &self.alarms.borrow(cs); |
| 90 | let timestamp = alarm.timestamp.get(); | 93 | let timestamp = alarm.timestamp.get(); |
| 91 | if timestamp <= self.now() { | 94 | if timestamp <= self.now() { |
| @@ -96,9 +99,6 @@ impl TimerDriver { | |||
| 96 | TIMER.alarm(n).write_value(timestamp as u32); | 99 | TIMER.alarm(n).write_value(timestamp as u32); |
| 97 | } | 100 | } |
| 98 | }); | 101 | }); |
| 99 | |||
| 100 | // clear the irq | ||
| 101 | TIMER.intr().write(|w| w.set_alarm(n, true)); | ||
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | fn trigger_alarm(&self, cs: CriticalSection) { | 104 | fn trigger_alarm(&self, cs: CriticalSection) { |
