aboutsummaryrefslogtreecommitdiffstats
path: root/src/pipe/addr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/pipe/addr.rs')
-rw-r--r--src/pipe/addr.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pipe/addr.rs b/src/pipe/addr.rs
index b3548cf..d71ee2d 100644
--- a/src/pipe/addr.rs
+++ b/src/pipe/addr.rs
@@ -17,7 +17,7 @@ pub struct W {
}
impl Addr {
- pub fn read(&self) -> R {
+ pub fn read(self) -> R {
R { bits: self.0 }
}
@@ -89,7 +89,7 @@ impl<'a> AddrW<'a> {
pub unsafe fn bits(self, v: u32) -> &'a mut W {
// Address must be 32-bit aligned. cf ยง32.8.7.2 of SAMD21 data
// sheet.
- assert!((v & 0x3) == 0);
+ debug_assert!(v.trailing_zeros() >= 2);
self.w.bits = v;
self.w
}