diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2023-04-04 20:03:58 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-04 20:03:58 +0000 |
| commit | 72ae46083e64acc012c6b85d3ef7a115657a01e3 (patch) | |
| tree | 024dbdb94cb5537312c5c34f121257265c165bea /rtic-time/src/monotonic.rs | |
| parent | 064cf19265f72d7f01e0847c545e6250391a2172 (diff) | |
| parent | aeec8bd41bdf3d57098902407ec320f59365641a (diff) | |
Merge #721
721: Added nRF monotonics r=perlindgren a=korken89
Testing completed
Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
Diffstat (limited to 'rtic-time/src/monotonic.rs')
| -rw-r--r-- | rtic-time/src/monotonic.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/rtic-time/src/monotonic.rs b/rtic-time/src/monotonic.rs index 9b3742f..513cc07 100644 --- a/rtic-time/src/monotonic.rs +++ b/rtic-time/src/monotonic.rs @@ -33,6 +33,13 @@ pub trait Monotonic { /// queue in RTIC checks this. fn set_compare(instant: Self::Instant); + /// Override for the dequeue check, override with timers that have bugs. + /// + /// E.g. nRF52 RTCs needs to be dequeued if the time is within 4 ticks. + fn should_dequeue_check(release_at: Self::Instant) -> bool { + <Self as Monotonic>::now() >= release_at + } + /// Clear the compare interrupt flag. fn clear_compare_flag(); |
