Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/qspi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -675,9 +675,7 @@ impl<CLK, NCS, IO0, IO1, IO2, IO3> Qspi<(CLK, NCS, IO0, IO1, IO2, IO3)> {
if let Some((data, _)) = command.data {
for byte in data {
while self.qspi.sr.read().ftf().bit_is_clear() {}
unsafe {
ptr::write_volatile(&self.qspi.dr as *const _ as *mut u8, *byte);
}
self.qspi.dr.write(|w| unsafe { w.bits(u32::from(*byte)) });
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/serial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ macro_rules! hal {
// NOTE(unsafe) atomic write to stateless register
// NOTE(write_volatile) 8-bit write that's not possible through the svd2rust API
unsafe {
ptr::write_volatile(&(*pac::$USARTX::ptr()).tdr as *const _ as *mut _, byte)
(*pac::$USARTX::ptr()).tdr.write(|w| { w.tdr().bits(u16::from(byte)) });
}
Ok(())
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/spi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ macro_rules! hal {
nb::Error::Other(Error::Crc)
} else if sr.txe().bit_is_set() {
// NOTE(write_volatile) see note above
unsafe { ptr::write_volatile(&self.spi.dr as *const _ as *mut u8, byte) }
self.spi.dr.write(|w| unsafe{ w.bits(u32::from(byte) ) });
return Ok(());
} else {
nb::Error::WouldBlock
Expand Down