diff options
| author | Ulf Lilleengen <[email protected]> | 2025-01-02 11:59:57 +0100 |
|---|---|---|
| committer | Ulf Lilleengen <[email protected]> | 2025-01-02 11:59:57 +0100 |
| commit | 9c7d508bcf3384ab0883c7ef710e485106ccbb6c (patch) | |
| tree | bac57a738cf72a52775001e5266849bc124e6fbc /embassy-nrf | |
| parent | e012e1385814647e1c17cb64175a19745c18bb8f (diff) | |
Fix case where a short interrupt caused wrong alarm set
Diffstat (limited to 'embassy-nrf')
| -rw-r--r-- | embassy-nrf/src/time_driver.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/embassy-nrf/src/time_driver.rs b/embassy-nrf/src/time_driver.rs index 01079e26a..ad61f5ca7 100644 --- a/embassy-nrf/src/time_driver.rs +++ b/embassy-nrf/src/time_driver.rs | |||
| @@ -250,9 +250,9 @@ impl RtcDriver { | |||
| 250 | r.intenclr().write(|w| w.0 = compare_n(n)); | 250 | r.intenclr().write(|w| w.0 = compare_n(n)); |
| 251 | } | 251 | } |
| 252 | 252 | ||
| 253 | // If we have not passed the safe timestamp, we can be sure the alarm will be invoked. Otherwise, | 253 | // If we have not passed the timestamp, we can be sure the alarm will be invoked. Otherwise, |
| 254 | // we need to retry setting the alarm. | 254 | // we need to retry setting the alarm. |
| 255 | if self.now() <= safe_timestamp { | 255 | if self.now() + 3 <= timestamp { |
| 256 | return true; | 256 | return true; |
| 257 | } | 257 | } |
| 258 | } | 258 | } |
