Function handle_interrupt

Source
pub fn handle_interrupt<'a>(
    get_timer: impl FnOnce() -> &'a AsyncTimer<Lptim1Rtc>,
) -> bool
Expand description

Handle the LPTIM1 interrupt.

Will yield whether the AsyncTimer has been awoken.

You can call it as such:

static mut TIMER: Option<AsyncTimer<Lptim1Rtc>> = None;

#[interrupt]
#[allow(non_snake_case)]
#[no_mangle]
fn LPTIM1() {
    cortex_m::interrupt::free(|_| {
        if let Some(timer) = unsafe { TIMER.as_ref() } {
            handle_interrupt(move || timer);
        }
    })
}