From 8c23e178f3838bcdd13662a2ffefd39ec144e869 Mon Sep 17 00:00:00 2001 From: Finomnis Date: Thu, 11 Apr 2024 00:00:38 +0200 Subject: Monotonic rewrite (#874) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Rework timer_queue and monotonic architecture Goals: * make Monotonic purely internal * make Monotonic purely tick passed, no fugit involved * create a wrapper struct in the user's code via a macro that then converts the "now" from the tick based monotonic to a fugit based timestamp We need to proxy the delay functions of the timer queue anyway, so we could simply perform the conversion in those proxy functions. * Update cargo.lock * Update readme of rtic-time * CI: ESP32: Redact esp_image: Too volatile * Fixup: Changelog double entry rebase mistake --------- Co-authored-by: Henrik Tjäder --- rtic-monotonics/src/lib.rs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'rtic-monotonics/src/lib.rs') diff --git a/rtic-monotonics/src/lib.rs b/rtic-monotonics/src/lib.rs index 6dc703e..65180b1 100644 --- a/rtic-monotonics/src/lib.rs +++ b/rtic-monotonics/src/lib.rs @@ -21,14 +21,18 @@ //! `Available on crate features X only` tag are available on any `nrf52*` feature. //! // To build these docs correctly: -// RUSTFLAGS="--cfg docsrs" cargo doc --featuers cortex-m-systick,rp2040,nrf52840 +// RUSTFLAGS="--cfg docsrs" cargo +nightly doc --features thumbv7-backend,cortex-m-systick,rp2040,nrf52840,imxrt_gpt1,imxrt_gpt2,imxrt-ral/imxrt1011,stm32h725ag,stm32_tim2,stm32_tim3,stm32_tim4,stm32_tim5,stm32_tim15 #![no_std] #![deny(missing_docs)] #![allow(incomplete_features)] #![cfg_attr(docsrs, feature(doc_cfg))] -pub use rtic_time::{Monotonic, TimeoutError, TimerQueue}; +pub use fugit; +pub use rtic_time::{ + self, monotonic::TimerQueueBasedMonotonic, timer_queue::TimerQueueBackend, Monotonic, + TimeoutError, +}; #[cfg(feature = "cortex-m-systick")] pub mod systick; @@ -92,13 +96,3 @@ pub(crate) unsafe fn set_monotonic_prio( nvic.set_priority(interrupt, hw_prio); } - -/// This marker is implemented on an interrupt token to enforce that the right tokens -/// are given to the correct monotonic implementation. -/// -/// This trait is implemented by this crate and not intended for user implementation. -/// -/// # Safety -/// -/// This is only safely implemented by this crate. -pub unsafe trait InterruptToken {} -- cgit v1.2.3