diff --git a/CHANGELOG.md b/CHANGELOG.md index d688384..e95ebc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Wrong mode when using PWM channel 2 of a two-channel timer - `adc_values` example conversion error +- `invalid_reference_casting` Compilation error in spi.rs for Rust version 1.73+ ( + See [PR#112431](https://github.com/rust-lang/rust/pull/112431) for more info) +- `unused_doc_comments` Warning in rcc.rs ## [v0.18.0] - 2021-11-14 diff --git a/src/rcc.rs b/src/rcc.rs index e013e7b..6e79f68 100644 --- a/src/rcc.rs +++ b/src/rcc.rs @@ -14,7 +14,7 @@ impl RccExt for RCC { pclk: None, sysclk: None, clock_src: SysClkSource::HSI, - /// CRS is only available on devices with HSI48 + // CRS is only available on devices with HSI48 #[cfg(any( feature = "stm32f042", feature = "stm32f048", diff --git a/src/spi.rs b/src/spi.rs index eb18dfe..17eeef7 100644 --- a/src/spi.rs +++ b/src/spi.rs @@ -413,7 +413,7 @@ where fn send_u8(&mut self, byte: u8) { // NOTE(write_volatile) see note above - unsafe { ptr::write_volatile(&self.spi.dr as *const _ as *mut u8, byte) } + unsafe { ptr::write_volatile(ptr::addr_of!(self.spi.dr) as *mut u8, byte) } } fn read_u16(&mut self) -> u16 { @@ -423,7 +423,7 @@ where fn send_u16(&mut self, byte: u16) { // NOTE(write_volatile) see note above - unsafe { ptr::write_volatile(&self.spi.dr as *const _ as *mut u16, byte) } + unsafe { ptr::write_volatile(ptr::addr_of!(self.spi.dr) as *mut u16, byte) } } pub fn release(self) -> (SPI, (SCKPIN, MISOPIN, MOSIPIN)) {