aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/register/control.rs30
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!(),