diff options
| author | Finomnis <Finomnis@users.noreply.github.com> | 2023-12-06 19:36:09 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-06 18:36:09 +0000 |
| commit | bbed94528528fbfe53ed7baf9cc38ca012785d13 (patch) | |
| tree | 45269ff41ff0007e2b405c5cbea2c3ba19928b46 /rtic-monotonics/src/nrf | |
| parent | f377471e440d8be0b2f9e9c8877ed015f62dc19e (diff) | |
Fix race condition in `calculate_now` (#860)
* Fix race condition in calculate_now
* Add changelog
* Update changelog
* Refine comment
* More comment fixes
Diffstat (limited to 'rtic-monotonics/src/nrf')
| -rw-r--r-- | rtic-monotonics/src/nrf/rtc.rs | 2 | ||||
| -rw-r--r-- | rtic-monotonics/src/nrf/timer.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/rtic-monotonics/src/nrf/rtc.rs b/rtic-monotonics/src/nrf/rtc.rs index 643d8bd..d425b11 100644 --- a/rtic-monotonics/src/nrf/rtc.rs +++ b/rtic-monotonics/src/nrf/rtc.rs @@ -224,7 +224,7 @@ macro_rules! make_rtc { fn now() -> Self::Instant { let rtc = unsafe { &*$rtc::PTR }; Self::Instant::from_ticks(calculate_now( - $overflow.load(Ordering::Relaxed), + || $overflow.load(Ordering::Relaxed), || TimerValueU24(rtc.counter.read().bits()) )) } diff --git a/rtic-monotonics/src/nrf/timer.rs b/rtic-monotonics/src/nrf/timer.rs index 2f83f40..7b760e4 100644 --- a/rtic-monotonics/src/nrf/timer.rs +++ b/rtic-monotonics/src/nrf/timer.rs @@ -242,7 +242,7 @@ macro_rules! make_timer { let timer = unsafe { &*$timer::PTR }; Self::Instant::from_ticks(calculate_now( - $overflow.load(Ordering::Relaxed), + || $overflow.load(Ordering::Relaxed), || { timer.tasks_capture[3].write(|w| unsafe { w.bits(1) }); timer.cc[3].read().bits() |
