271: Minor docs update to monotonic r=japaric a=korken89



Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
This commit is contained in:
bors[bot] 2019-11-13 20:20:30 +00:00 committed by GitHub
commit e28294b220
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -128,10 +128,12 @@ pub struct Fraction {
/// A monotonic clock / counter /// A monotonic clock / counter
pub trait Monotonic { pub trait Monotonic {
/// A measurement of this clock /// A measurement of this clock, use `CYCCNT` as a reference implementation for `Instant`.
/// Note that the Instant must be a signed value such as `i32`.
type Instant: Copy + Ord + Sub; type Instant: Copy + Ord + Sub;
/// The ratio between the SysTick (system timer) frequency and this clock frequency /// The ratio between the system timer (SysTick) frequency and this clock frequency, i.e.
/// `Monotonic clock * Fraction = System clock`
/// ///
/// The ratio must be expressed in *reduced* `Fraction` form to prevent overflows. That is /// The ratio must be expressed in *reduced* `Fraction` form to prevent overflows. That is
/// `2 / 3` instead of `4 / 6` /// `2 / 3` instead of `4 / 6`