Skip to content

Commit 479dbae

Browse files
sirhcelSh3Rm4n
authored andcommitted
Clean up unsafe write to USART TDR
Accessing the USARTs TDR is safe again with stm32f3 0.13.2.
1 parent 555b0e1 commit 479dbae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/serial.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ where
340340

341341
fn write(&mut self, byte: u8) -> nb::Result<(), Infallible> {
342342
if self.usart.isr.read().txe().bit_is_set() {
343-
self.usart.tdr.write(|w| unsafe { w.tdr().bits(u16::from(byte)) });
343+
self.usart.tdr.write(|w| w.tdr().bits(u16::from(byte)));
344344
Ok(())
345345
} else {
346346
Err(nb::Error::WouldBlock)

0 commit comments

Comments
 (0)