diff options
author | 2017-12-23 18:48:20 +0100 | |
---|---|---|
committer | 2017-12-23 18:48:20 +0100 | |
commit | 875ee38398f62b4c89e97ff891554d6fd5b7fafb (patch) | |
tree | b348726a7dd842a210345b0afc975697ee43765c /src/interrupt.rs | |
parent | 9a80bae79d1eb9111e50406cb7cc088246deb04d (diff) | |
download | cortex-m-875ee38398f62b4c89e97ff891554d6fd5b7fafb.tar.gz cortex-m-875ee38398f62b4c89e97ff891554d6fd5b7fafb.tar.zst cortex-m-875ee38398f62b4c89e97ff891554d6fd5b7fafb.zip |
map asm! ops to unimplemented! on non ARM targets
Diffstat (limited to 'src/interrupt.rs')
-rw-r--r-- | src/interrupt.rs | 22 |
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!(), } } |