Use modify instead of write for regs within a driver.
This commit is contained in:
parent
d890ef98c1
commit
8b36269d65
@ -54,7 +54,7 @@ impl<'d, T: Instance> Spi<'d, T> {
|
|||||||
let miso = miso.degrade();
|
let miso = miso.degrade();
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
T::regs().cr2().write(|w| {
|
T::regs().cr2().modify(|w| {
|
||||||
w.set_ssoe(false);
|
w.set_ssoe(false);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -62,7 +62,7 @@ impl<'d, T: Instance> Spi<'d, T> {
|
|||||||
let br = Self::compute_baud_rate(pclk, freq.into());
|
let br = Self::compute_baud_rate(pclk, freq.into());
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
T::regs().cr1().write(|w| {
|
T::regs().cr1().modify(|w| {
|
||||||
w.set_cpha(
|
w.set_cpha(
|
||||||
match config.mode.phase == Phase::CaptureOnSecondTransition {
|
match config.mode.phase == Phase::CaptureOnSecondTransition {
|
||||||
true => spi::vals::Cpha::SECONDEDGE,
|
true => spi::vals::Cpha::SECONDEDGE,
|
||||||
|
Loading…
Reference in New Issue
Block a user