diff options
author | 2017-12-23 17:51:13 +0000 | |
---|---|---|
committer | 2017-12-23 17:51:13 +0000 | |
commit | bdc7ca96c5593e410c8f49025d2b0fced7607a4d (patch) | |
tree | eafb76c2e0eee5492e18ac931e28c50b1be13a7a /src/interrupt.rs | |
parent | 9a80bae79d1eb9111e50406cb7cc088246deb04d (diff) | |
parent | f79f4b73fb19ad537669d71f3f567aad9810a8f5 (diff) | |
download | cortex-m-bdc7ca96c5593e410c8f49025d2b0fced7607a4d.tar.gz cortex-m-bdc7ca96c5593e410c8f49025d2b0fced7607a4d.tar.zst cortex-m-bdc7ca96c5593e410c8f49025d2b0fced7607a4d.zip |
Auto merge of #71 - japaric:unimplemented-asm, r=japaric
map asm! ops to unimplemented! on non ARM targets
closes #63
cc @hannobraun
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!(), } } |