Skip to content

Commit

Permalink
Fix compile error of 'assigning to &T is undefined behavior'
Browse files Browse the repository at this point in the history
Signed-off-by: Chien Wong <[email protected]>
  • Loading branch information
ivq committed Nov 25, 2023
1 parent fdb0685 commit 06bb998
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/serial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ impl<USART: UsartX> crate::hal::serial::Write<u8> for Tx<USART> {
// NOTE(unsafe) atomic write to stateless register
// NOTE(write_volatile) 8-bit write that's not possible through the svd2rust API
unsafe {
#[allow(invalid_reference_casting)]
ptr::write_volatile(&(*USART::ptr()).data as *const _ as *mut _, byte)
}
Ok(())
Expand Down

0 comments on commit 06bb998

Please sign in to comment.