Fix case where a short interrupt caused wrong alarm set

This commit is contained in:
Ulf Lilleengen 2025-01-02 11:59:57 +01:00
parent e012e13858
commit 9c7d508bcf

View File

@ -250,9 +250,9 @@ impl RtcDriver {
r.intenclr().write(|w| w.0 = compare_n(n)); 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. // we need to retry setting the alarm.
if self.now() <= safe_timestamp { if self.now() + 3 <= timestamp {
return true; return true;
} }
} }