Skip to content

Commit da47112

Browse files
committed
fix: compilation on nightly
1 parent 21b5785 commit da47112

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

src/flash.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ impl<'a> EraseSequence<'a> {
202202
flash.check_locked_or_busy()?;
203203
flash.clear_errors();
204204

205-
flash.registers.cr.modify(|_, w| unsafe {
205+
flash.registers.cr.modify(|_, w| {
206206
#[cfg(any(
207207
feature = "stm32f765",
208208
feature = "stm32f767",

src/serial.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use core::marker::PhantomData;
55
use core::ops::Deref;
66
use core::ops::DerefMut;
77
use core::pin::Pin;
8-
use core::ptr;
98

109
use as_slice::{AsMutSlice, AsSlice};
1110

@@ -167,10 +166,7 @@ where
167166

168167
// Enable tx / rx, configure data bits and parity
169168
usart.cr1.modify(|_, w| {
170-
w
171-
.te().enabled()
172-
.re().enabled()
173-
.ue().enabled();
169+
w.te().enabled().re().enabled().ue().enabled();
174170

175171
// M[1:0] are used to set data bits
176172
// M[1:0] = 00: 1 Start bit, 8 data bits, n stop bits
@@ -184,7 +180,7 @@ where
184180

185181
match config.parity {
186182
Parity::ParityEven => w.ps().even().pce().enabled(),
187-
Parity::ParityOdd => w.ps().odd().pce().enabled(),
183+
Parity::ParityOdd => w.ps().odd().pce().enabled(),
188184
Parity::ParityNone => w.pce().disabled(),
189185
}
190186
});
@@ -422,7 +418,7 @@ where
422418
if isr.txe().bit_is_set() {
423419
// NOTE(unsafe) atomic write to stateless register
424420
// NOTE(write_volatile) 8-bit write that's not possible through the svd2rust API
425-
unsafe { ptr::write_volatile(&(*USART::ptr()).tdr as *const _ as *mut _, byte) }
421+
unsafe { (*USART::ptr()).tdr.write(|w| w.tdr().bits(byte as u16)) }
426422
Ok(())
427423
} else {
428424
Err(nb::Error::WouldBlock)
@@ -438,7 +434,6 @@ pub struct Config {
438434
pub sysclock: bool,
439435
pub parity: Parity,
440436
pub data_bits: DataBits,
441-
442437
}
443438

444439
pub enum Oversampling {

src/spi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ macro_rules! impl_instance {
424424
// memory-mapped register.
425425
unsafe {
426426
ptr::write_volatile(
427-
&self.dr as *const _ as *mut _,
427+
self.dr_address() as *mut u32 as *mut _,
428428
word,
429429
);
430430
}

0 commit comments

Comments
 (0)