pub fn handle_timer_overflow() {
    // Safety explanation:
    // This function should only be called from the timer interrupt, which has higher priority
    // than any code that calls microseconds_now(). It reads INITIALIZED, reads/modifies/writes
    // Timer.UIF, and reads/modifies/writes OVERFLOW_COUNT.
    //
    // No other code accesses Timer.UIF. No other code writes INITIALIZED after init() returns.
    // No other code writes OVERFLOW_COUNT.
    //
    // Because of the interrupt priority rule, no other code can read OVERFLOW_COUNT in between
    // when the timer overflows and when this function returns.
    unsafe {
        if INITIALIZED {
            let timer = &*Timer::ptr();
            if timer.sr.read().uif().bit_is_set() {
                // Clear interrupt flag
                timer.sr.write(|w| w.uif().clear_bit());
                OVERFLOW_COUNT = OVERFLOW_COUNT.wrapping_add(1);
            }
        }
    }
}
/// Handles an interrupt from the timer
Handles an interrupt from the timer
Handles an interrupt from the timer
pub fn handle_timer_overflow() {
    // Safety explanation:
    // This function should only be called from the timer interrupt, which has higher priority
    // than any code that calls microseconds_now(). It reads INITIALIZED, reads/modifies/writes
    // Timer.UIF, and reads/modifies/writes OVERFLOW_COUNT.
    //
    // No other code accesses Timer.UIF. No other code writes INITIALIZED after init() returns.
    // No other code writes OVERFLOW_COUNT.
    //
    // Because of the interrupt priority rule, no other code can read OVERFLOW_COUNT in between
    // when the timer overflows and when this function returns.
    unsafe {
        if INITIALIZED {
            let timer = &*Timer::ptr();
            if timer.sr.read().uif().bit_is_set() {
                // Clear interrupt flag
                timer.sr.write(|w| w.uif().clear_bit());
                OVERFLOW_COUNT = OVERFLOW_COUNT.wrapping_add(1);
            }
        }
    }
}
pub fn handle_timer_overflow ( ) { // Safety explanation: // This function should only be called from the timer interrupt, which has higher priority // than any code that calls microseconds_now(). It reads INITIALIZED, reads/modifies/writes // Timer.UIF, and reads/modifies/writes OVERFLOW_COUNT. // // No other code accesses Timer.UIF. No other code writes INITIALIZED after init() returns. // No other code writes OVERFLOW_COUNT. // // Because of the interrupt priority rule, no other code can read OVERFLOW_COUNT in between // when the timer overflows and when this function returns. unsafe { if INITIALIZED { let timer = & * Timer :: ptr ( ) ; if timer . sr . read ( ) . uif ( ) . bit_is_set ( ) { // Clear interrupt flag timer . sr . write ( | w | w . uif ( ) . clear_bit ( ) ) ; OVERFLOW_COUNT = OVERFLOW_COUNT . wrapping_add ( 1 ) ; } } } }
Handles an interrupt from the timer
Handles an interrupt from the timer