Skip to content

Commit

Permalink
Fixed an error with SPI on H7
Browse files Browse the repository at this point in the history
  • Loading branch information
David-OConnor committed Feb 22, 2024
1 parent 59eda96 commit ea145a2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "stm32-hal2"
version = "1.8.1"
version = "1.8.2"
authors = ["David O'Connor <[email protected]>"]
description = "Hardware abstraction layer for the STM32 MCUs"
keywords = ["no-std", "stm32", "embedded", "embedded-hal"]
Expand Down
5 changes: 2 additions & 3 deletions src/clocks/h.rs
Original file line number Diff line number Diff line change
Expand Up @@ -665,9 +665,8 @@ impl Clocks {

// todo: Add config enums for these, and add them as Clocks fields.
#[cfg(not(any(feature = "h7b3", feature = "h5")))]
rcc.d2ccip2r.modify(|_, w| unsafe {
w.usbsel().bits(self.usb_src as u8)
});
rcc.d2ccip2r
.modify(|_, w| unsafe { w.usbsel().bits(self.usb_src as u8) });

#[cfg(not(any(feature = "h7b3", feature = "h5")))]
rcc.d3ccipr.modify(|_, w| unsafe {
Expand Down
1 change: 0 additions & 1 deletion src/rng.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,3 @@ pub fn reading_ready() -> bool {
let regs = unsafe { &(*RNG::ptr()) };
regs.sr.read().drdy().bit_is_set()
}

4 changes: 2 additions & 2 deletions src/spi/h.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ where

// Continue filling write FIFO and emptying read FIFO
for word in write {
let _ = self.exchange_duplex(*word);
let _ = self.exchange(*word);
}

// Dummy read from the read FIFO
Expand All @@ -269,7 +269,7 @@ where
for i in FIFO_LEN..len + FIFO_LEN {
if i < len {
// Continue filling write FIFO and emptying read FIFO
let read_value = self.exchange_duplex(words[i])?;
let read_value = self.exchange(words[i])?;

words[i - FIFO_LEN] = read_value;
} else {
Expand Down

0 comments on commit ea145a2

Please sign in to comment.