File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change 11//! [`Monotonic`](rtic_time::Monotonic) based on Cortex-M SysTick.
2+ //!
23//! Note: this implementation is inefficient as it
34//! ticks and generates interrupts at a constant rate.
45//!
910//! systick_monotonic!(Mono, 1_000);
1011//!
1112//! fn init() {
12- //! # // This is normally provided by the selected PAC
13- //! # let systick = unsafe { core::mem::transmute(()) };
14- //! #
15- //! // Start the monotonic
16- //! Mono::start(systick, 12_000_000);
13+ //! let core_peripherals = cortex_m::Peripherals::take().unwrap();
14+ //! // Start the monotonic using the cortex-m crate's Systick driver
15+ //! Mono::start(core_peripherals.SYST, 12_000_000);
1716//! }
1817//!
1918//! async fn usage() {
@@ -134,6 +133,15 @@ impl TimerQueueBackend for SystickBackend {
134133
135134/// Create a Systick based monotonic and register the Systick interrupt for it.
136135///
136+ /// This macro expands to produce a new type called `$name`, which has a `fn
137+ /// start()` function for you to call. The type has an implementation of the
138+ /// `rtic_monotonics::TimerQueueBasedMonotonic` trait, the
139+ /// `embedded_hal::delay::DelayNs` trait and the
140+ /// `embedded_hal_async::delay::DelayNs` trait.
141+ ///
142+ /// This macro also produces an interrupt handler for the SysTick interrupt, by
143+ /// creating an `extern "C" fn SysTick() { ... }`.
144+ ///
137145/// See [`crate::systick`] for more details.
138146///
139147/// # Arguments
You can’t perform that action at this time.
0 commit comments