From 9c7d508bcf3384ab0883c7ef710e485106ccbb6c Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Thu, 2 Jan 2025 11:59:57 +0100 Subject: [PATCH] Fix case where a short interrupt caused wrong alarm set --- embassy-nrf/src/time_driver.rs | 4 ++-- 1 file 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 { r.intenclr().write(|w| w.0 = compare_n(n)); } - // If we have not passed the safe timestamp, we can be sure the alarm will be invoked. Otherwise, + // If we have not passed the timestamp, we can be sure the alarm will be invoked. Otherwise, // we need to retry setting the alarm. - if self.now() <= safe_timestamp { + if self.now() + 3 <= timestamp { return true; } }