Skip to content

Commit 7d5477a

Browse files
committed
smallrevert bits
1 parent 8b39c1f commit 7d5477a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/generate/generic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub fn render() -> Result<Vec<Tokens>> {
2020
generic_items.push(quote! {
2121
///Value read from the register
2222
pub struct FR<U, T> {
23-
bits: U,
23+
pub(crate) bits: U,
2424
_reg: marker::PhantomData<T>,
2525
}
2626

src/generate/register.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -337,11 +337,11 @@ pub fn fields(
337337
let value = if offset != 0 {
338338
let offset = &f.offset;
339339
quote! {
340-
((self.bits() >> #offset) & #mask) #cast
340+
((self.bits >> #offset) & #mask) #cast
341341
}
342342
} else {
343343
quote! {
344-
(self.bits() & #mask) #cast
344+
(self.bits & #mask) #cast
345345
}
346346
};
347347

@@ -407,7 +407,7 @@ pub fn fields(
407407
#[inline(always)]
408408
pub fn variant(&self) -> crate::Variant<#fty, #pc_r> {
409409
use crate::Variant::*;
410-
match self.bits() {
410+
match self.bits {
411411
#(#arms),*
412412
}
413413
}
@@ -417,7 +417,7 @@ pub fn fields(
417417
///Enumerated values
418418
#[inline(always)]
419419
pub fn variant(&self) -> #pc_r {
420-
match self.bits() {
420+
match self.bits {
421421
#(#arms),*
422422
}
423423
}

0 commit comments

Comments
 (0)