pub fn current_runlevel() -> Priority {
    let ps: u32;
    unsafe { core::arch::asm!("rsr.ps {0}", out(reg) ps) };

    let prev_interrupt_priority = ps as u8 & 0x0F;

    unwrap!(Priority::try_from(prev_interrupt_priority))
}
Get the current run level (the level below which interrupts are masked).
esp-hal/src/interrupt/xtensa.rs