From 6a45bdefba2f8417410715c593f72a5fe95cfe2b Mon Sep 17 00:00:00 2001 From: Jonathan 'theJPster' Pallant Date: Sun, 15 Jun 2025 13:24:18 +0100 Subject: Add details for all the other monotonic implementations. --- rtic-monotonics/src/rp235x.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'rtic-monotonics/src/rp235x.rs') diff --git a/rtic-monotonics/src/rp235x.rs b/rtic-monotonics/src/rp235x.rs index 7624d1d..d58139a 100644 --- a/rtic-monotonics/src/rp235x.rs +++ b/rtic-monotonics/src/rp235x.rs @@ -8,21 +8,25 @@ //! ``` //! use rtic_monotonics::rp235x::prelude::*; //! +//! // Create the type `Mono`. It will manage the TIMER0 peripheral, +//! // which is a 1 MHz, 64-bit timer. //! rp235x_timer_monotonic!(Mono); //! //! fn init() { //! # // This is normally provided by the selected PAC -//! # let timer = unsafe { core::mem::transmute(()) }; -//! # let mut resets = unsafe { core::mem::transmute(()) }; +//! # let TIMER = unsafe { core::mem::transmute(()) }; +//! # let mut RESETS = unsafe { core::mem::transmute(()) }; //! # -//! // Start the monotonic -//! Mono::start(timer, &mut resets); +//! // Start the monotonic - passing ownership of an rp235x_pac object for +//! // TIMER0, and temporary access to one for the RESET peripheral. +//! Mono::start(TIMER, &mut RESETS); //! } //! //! async fn usage() { //! loop { -//! // Use the monotonic +//! // You can use the monotonic to get the time... //! let timestamp = Mono::now(); +//! // ...and you can use it to add a delay to this async function //! Mono::delay(100.millis()).await; //! } //! } -- cgit v1.2.3