aboutsummaryrefslogtreecommitdiff
path: root/rtic-time/src/lib.rs
diff options
context:
space:
mode:
authorGravatar Finomnis <Finomnis@users.noreply.github.com> 2023-12-06 19:36:06 +0100
committerGravatar GitHub <noreply@github.com> 2023-12-06 18:36:06 +0000
commitf377471e440d8be0b2f9e9c8877ed015f62dc19e (patch)
tree2f63c1c079bf95cd8468ba2de91cb01032966aab /rtic-time/src/lib.rs
parent89160b7cb9b3623e0a50f6745296d470fa7ea79d (diff)
downloadrtic-f377471e440d8be0b2f9e9c8877ed015f62dc19e.tar.gz
rtic-f377471e440d8be0b2f9e9c8877ed015f62dc19e.tar.zst
rtic-f377471e440d8be0b2f9e9c8877ed015f62dc19e.zip
Fix `nrf::rtc` errata workaround (#858)
* Deprecate `should_dequeue_check` * Fix errata by delaying the wakeup point * Add changelog * Fix changelog typos
Diffstat (limited to 'rtic-time/src/lib.rs')
-rw-r--r--rtic-time/src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/rtic-time/src/lib.rs b/rtic-time/src/lib.rs
index 6254bca0..9cd20d5f 100644
--- a/rtic-time/src/lib.rs
+++ b/rtic-time/src/lib.rs
@@ -133,7 +133,7 @@ impl<Mono: Monotonic> TimerQueue<Mono> {
let head = self.queue.pop_if(|head| {
release_at = Some(head.release_at);
- let should_pop = Mono::should_dequeue_check(head.release_at);
+ let should_pop = Mono::now() >= head.release_at;
head.was_popped.store(should_pop, Ordering::Relaxed);
should_pop
@@ -147,7 +147,7 @@ impl<Mono: Monotonic> TimerQueue<Mono> {
Mono::enable_timer();
Mono::set_compare(instant);
- if Mono::should_dequeue_check(instant) {
+ if Mono::now() >= instant {
// The time for the next instant passed while handling it,
// continue dequeueing
continue;