Skip to content

Commit 5e71346

Browse files
committed
More adjustments for unsafe-cell
1 parent 9cd022c commit 5e71346

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/spi.rs

+2
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,7 @@ where
651651
fn send(&mut self, word: u8) -> Result<(), SpiError> {
652652
// NOTE(write_volatile) see note above
653653
unsafe {
654+
#[allow(invalid_reference_casting)]
654655
ptr::write_volatile(&self.regs.txdr as *const _ as *mut u8, word);
655656
}
656657
// write CSTART to start a transaction in
@@ -675,6 +676,7 @@ where
675676
return Err(SpiError::Crc);
676677
}
677678

679+
#[allow(invalid_reference_casting)]
678680
unsafe {
679681
ptr::write_volatile(&self.regs.txdr as *const _ as *mut _, word);
680682
Ok(ptr::read_volatile(&self.regs.rxdr as *const _ as *const u8))

0 commit comments

Comments
 (0)