Skip to content

Commit e6f511a

Browse files
committed
Move the whole shift to the constant
1 parent 49a6dae commit e6f511a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/peripheral/dcb.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use volatile_register::{RW, WO};
44

55
use peripheral::DCB;
66

7-
const BIT_TRACENA: u8 = 24;
7+
const BIT_TRACENA: u32 = 0x01 << 24;
88

99
/// Register block
1010
#[repr(C)]
@@ -26,12 +26,12 @@ impl DCB {
2626
/// soft-reset, only on power reset.
2727
pub fn enable_trace(&mut self) {
2828
// set bit 24 / TRACENA
29-
unsafe { self.demcr.modify(|w| w | (0x01 << BIT_TRACENA)); }
29+
unsafe { self.demcr.modify(|w| w | BIT_TRACENA); }
3030
}
3131

3232
/// Disables TRACE. See `DCB::enable_trace()` for more details
3333
pub fn disable_trace(&mut self) {
3434
// unset bit 24 / TRACENA
35-
unsafe { self.demcr.modify(|w| w & !(0x01 << BIT_TRACENA)); }
35+
unsafe { self.demcr.modify(|w| w & !BIT_TRACENA); }
3636
}
3737
}

0 commit comments

Comments
 (0)