aboutsummaryrefslogtreecommitdiff
path: root/src/interrupt.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/interrupt.rs')
-rw-r--r--src/interrupt.rs22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/interrupt.rs b/src/interrupt.rs
index de11125..5880dd4 100644
--- a/src/interrupt.rs
+++ b/src/interrupt.rs
@@ -3,19 +3,15 @@
pub use bare_metal::{CriticalSection, Mutex, Nr};
/// Disables all interrupts
-#[inline(always)]
+#[inline]
pub fn disable() {
match () {
#[cfg(target_arch = "arm")]
() => unsafe {
- asm!("cpsid i"
- :
- :
- : "memory"
- : "volatile");
+ asm!("cpsid i" ::: "memory" : "volatile");
},
#[cfg(not(target_arch = "arm"))]
- () => {}
+ () => unimplemented!(),
}
}
@@ -24,19 +20,13 @@ pub fn disable() {
/// # Safety
///
/// - Do not call this function inside an `interrupt::free` critical section
-#[inline(always)]
+#[inline]
pub unsafe fn enable() {
match () {
#[cfg(target_arch = "arm")]
- () => {
- asm!("cpsie i"
- :
- :
- : "memory"
- : "volatile");
- }
+ () => asm!("cpsie i" ::: "memory" : "volatile"),
#[cfg(not(target_arch = "arm"))]
- () => {}
+ () => unimplemented!(),
}
}