mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-16 21:05:35 +01:00
Fix race condition in calculate_now (#860)
* Fix race condition in calculate_now * Add changelog * Update changelog * Refine comment * More comment fixes
This commit is contained in:
parent
f377471e44
commit
bbed945285
8 changed files with 27 additions and 15 deletions
|
|
@ -13,6 +13,7 @@ For each category, *Added*, *Changed*, *Fixed* add new entries at the top!
|
|||
- Fix race condition in `nrf::rtc`.
|
||||
- Fix errata in `nrf::rtc`.
|
||||
- Add internal counter integrity check to all half-period based monotonics.
|
||||
- Apply race condition fixes from `rtic-time`.
|
||||
|
||||
## v1.4.0 - 2023-12-04
|
||||
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ macro_rules! make_timer {
|
|||
let gpt = unsafe{ $timer::instance() };
|
||||
|
||||
Self::Instant::from_ticks(calculate_now(
|
||||
$period.load(Ordering::Relaxed),
|
||||
|| $period.load(Ordering::Relaxed),
|
||||
|| ral::read_reg!(ral::gpt, gpt, CNT)
|
||||
))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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())
|
||||
))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ macro_rules! make_timer {
|
|||
|
||||
fn now() -> Self::Instant {
|
||||
Self::Instant::from_ticks(calculate_now(
|
||||
$overflow.load(Ordering::Relaxed),
|
||||
|| $overflow.load(Ordering::Relaxed),
|
||||
|| $timer.cnt().read().cnt()
|
||||
))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue