fn count(&self) -> Wrapping<u32> {
        // This is all unsafe because incrementing the internal count happens as
        // a side effect of reading it. We’re ok with that, because we know that
        // we have sole control over the SYST singleton, so we’re the only ones
        // who will see the wrapping.
        if unsafe { (*self.syst.get()).has_wrapped() } {
            // Disabled interrupts because += is non-atomic.
            cortex_m::interrupt::free(|_| unsafe {
                (*self.counter.get()) += Wrapping(1);
            });
        }

        unsafe { *self.counter.get() }
    }
/// Returns a number that goes up no faster than once per millisecond. This
/// value will not increment unless polled (this is so it can operate
/// during critical sections when interrupts are disabled).
Returns a number that goes up no faster than once per millisecond. This
value will not increment unless polled (this is so it can operate
during critical sections when interrupts are disabled).
Returns a number that goes up no faster than once per millisecond . This value will not increment unless polled ( this is so it can operate during critical sections when interrupts are disabled ) .
fn count(&self) -> Wrapping<u32> {
        // This is all unsafe because incrementing the internal count happens as
        // a side effect of reading it. We’re ok with that, because we know that
        // we have sole control over the SYST singleton, so we’re the only ones
        // who will see the wrapping.
        if unsafe { (*self.syst.get()).has_wrapped() } {
            // Disabled interrupts because += is non-atomic.
            cortex_m::interrupt::free(|_| unsafe {
                (*self.counter.get()) += Wrapping(1);
            });
        }
        unsafe { *self.counter.get() }
    }
fn count ( & self ) -> Wrapping < u32 > { // This is all unsafe because incrementing the internal count happens as // a side effect of reading it. We’re ok with that, because we know that // we have sole control over the SYST singleton, so we’re the only ones // who will see the wrapping. if unsafe { ( * self . syst . get ( ) ) . has_wrapped ( ) } { // Disabled interrupts because += is non-atomic. cortex_m :: interrupt :: free ( | _ | unsafe { ( * self . counter . get ( ) ) += Wrapping ( 1 ) ; } ) ; } unsafe { * self . counter . get ( ) } }
Returns a number that goes up no faster than once per millisecond.
Returns a number that goes up no faster than once per millisecond .
&self
&self