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 1
1
//! [`Monotonic`](rtic_time::Monotonic) based on Cortex-M SysTick.
2
+ //!
2
3
//! Note: this implementation is inefficient as it
3
4
//! ticks and generates interrupts at a constant rate.
4
5
//!
9
10
//! systick_monotonic!(Mono, 1_000);
10
11
//!
11
12
//! 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);
17
16
//! }
18
17
//!
19
18
//! async fn usage() {
@@ -134,6 +133,15 @@ impl TimerQueueBackend for SystickBackend {
134
133
135
134
/// Create a Systick based monotonic and register the Systick interrupt for it.
136
135
///
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
+ ///
137
145
/// See [`crate::systick`] for more details.
138
146
///
139
147
/// # Arguments
You can’t perform that action at this time.
0 commit comments