Skip to content

Commit

Permalink
Fixed crc on l4
Browse files Browse the repository at this point in the history
  • Loading branch information
David-OConnor committed Aug 26, 2023
1 parent 11786f2 commit c38d76b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/crc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ impl Crc {
}

// writing to INIT sets DR to its value
#[cfg(not(feature = "h7"))]
#[cfg(not(any(feature = "h7", feature = "l4")))]
self.regs
.init
.write(|w| unsafe { w.crc_init().bits(config.initial) });
#[cfg(feature = "h7")]
#[cfg(any(feature = "h7", feature = "l4"))]
self.regs
.init
.write(|w| unsafe { w.init().bits(config.initial) });
Expand Down Expand Up @@ -152,9 +152,9 @@ impl Crc {
/// Read the CRC without applying output XOR.
#[inline(always)]
fn read_crc_no_xor(&self) -> u32 {
#[cfg(not(feature = "h7"))]
#[cfg(not(any(feature = "h7", feature = "l4")))]
return self.regs.dr.read().dr().bits();
#[cfg(feature = "h7")]
#[cfg(any(feature = "h7", feature = "l4"))]
return self.regs.dr().read().dr().bits();
}

Expand Down

0 comments on commit c38d76b

Please sign in to comment.