cortex_m/register/basepri_max.rs
1//! Base Priority Mask Register (conditional write)
2
3/// Writes to BASEPRI *if*
4///
5/// - `basepri != 0` AND `basepri::read() == 0`, OR
6/// - `basepri != 0` AND `basepri < basepri::read()`
7///
8/// **IMPORTANT** If you are using a Cortex-M7 device with revision r0p1 you MUST enable the
9/// `cm7-r0p1` Cargo feature or this function WILL misbehave.
10#[inline]
11pub fn write(basepri: u8) {
12 #[cfg(feature = "cm7-r0p1")]
13 {
14 call_asm!(__basepri_max_cm7_r0p1(basepri: u8));
15 }
16
17 #[cfg(not(feature = "cm7-r0p1"))]
18 {
19 call_asm!(__basepri_max(basepri: u8));
20 }
21}