Move shift-constant 24 to BIT_TRACENA
@@ -4,6 +4,8 @@ use volatile_register::{RW, WO};
use peripheral::DCB;
+const BIT_TRACENA: u8 = 24;
+
/// Register block
#[repr(C)]
pub struct RegisterBlock {
@@ -24,12 +26,12 @@ impl DCB {
/// soft-reset, only on power reset.
pub fn enable_trace(&mut self) {
// set bit 24 / TRACENA
- unsafe { self.demcr.modify(|w| w | (0x01 << 24)); }
+ unsafe { self.demcr.modify(|w| w | (0x01 << BIT_TRACENA)); }
}
/// Disables TRACE. See `DCB::enable_trace()` for more details
pub fn disable_trace(&mut self) {
// unset bit 24 / TRACENA
- unsafe { self.demcr.modify(|w| w & !(0x01 << 24)); }
+ unsafe { self.demcr.modify(|w| w & !(0x01 << BIT_TRACENA)); }
}
}
