Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use cortex_m::interrupt;
use cortex_m::register::primask;

/// Get specific interrupts and returns the current setting
#[inline]
pub fn get_mask() -> u32 {
    primask::read().is_active() as u32
}

/// Set specific interrupts
#[inline]
pub unsafe fn set_mask(mask: u32) {
    if mask == 0 {
        interrupt::disable();
    } else {
        interrupt::enable();
    }
}