We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9cd022c commit 5e71346Copy full SHA for 5e71346
src/spi.rs
@@ -651,6 +651,7 @@ where
651
fn send(&mut self, word: u8) -> Result<(), SpiError> {
652
// NOTE(write_volatile) see note above
653
unsafe {
654
+ #[allow(invalid_reference_casting)]
655
ptr::write_volatile(&self.regs.txdr as *const _ as *mut u8, word);
656
}
657
// write CSTART to start a transaction in
@@ -675,6 +676,7 @@ where
675
676
return Err(SpiError::Crc);
677
678
679
680
681
ptr::write_volatile(&self.regs.txdr as *const _ as *mut _, word);
682
Ok(ptr::read_volatile(&self.regs.rxdr as *const _ as *const u8))
0 commit comments