diff options
author | 2019-09-08 00:31:03 +0200 | |
---|---|---|
committer | 2019-09-08 00:31:03 +0200 | |
commit | 33aad220841e6abe0ae5abd565c3f166b8d9ec7a (patch) | |
tree | b2a6f88ffeae25d0c6acfa9fa20999f86e4863f1 /src | |
parent | f812b5f9de3481467bdc3eda30624706226182bd (diff) | |
download | cortex-m-33aad220841e6abe0ae5abd565c3f166b8d9ec7a.tar.gz cortex-m-33aad220841e6abe0ae5abd565c3f166b8d9ec7a.tar.zst cortex-m-33aad220841e6abe0ae5abd565c3f166b8d9ec7a.zip |
Fix errors and warnings
Diffstat (limited to 'src')
-rw-r--r-- | src/register/control.rs | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/src/register/control.rs b/src/register/control.rs index c08522c..52c412e 100644 --- a/src/register/control.rs +++ b/src/register/control.rs @@ -172,24 +172,22 @@ pub fn read() -> Control { pub unsafe fn write(_control: Control) { match () { #[cfg(cortex_m)] - () => { - let r = match () { - #[cfg(feature = "inline-asm")] - () => { - let control = _control.bits(); - unsafe { asm!("msr CONTROL, $0" :: "r"(control) : "memory" : "volatile") } + () => match () { + #[cfg(feature = "inline-asm")] + () => { + let control = _control.bits(); + unsafe { asm!("msr CONTROL, $0" :: "r"(control) : "memory" : "volatile") } + } + + #[cfg(not(feature = "inline-asm"))] + () => { + extern "C" { + fn __control_w(bits: u32); } - #[cfg(not(feature = "inline-asm"))] - () => unsafe { - extern "C" { - fn __control_w() -> u32; - } - - __control_w(_control.bits()) - }, - }; - } + __control_w(_control.bits()); + } + }, #[cfg(not(cortex_m))] () => unimplemented!(), |