From 8b36269d65ecf7c0f314e5e30e0d8cf3abef338c Mon Sep 17 00:00:00 2001 From: Bob McWhirter Date: Thu, 20 May 2021 14:14:31 -0400 Subject: [PATCH] Use modify instead of write for regs within a driver. --- embassy-stm32/src/spi/v1.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/embassy-stm32/src/spi/v1.rs b/embassy-stm32/src/spi/v1.rs index 43557325..fd0a0e7f 100644 --- a/embassy-stm32/src/spi/v1.rs +++ b/embassy-stm32/src/spi/v1.rs @@ -54,7 +54,7 @@ impl<'d, T: Instance> Spi<'d, T> { let miso = miso.degrade(); unsafe { - T::regs().cr2().write(|w| { + T::regs().cr2().modify(|w| { w.set_ssoe(false); }); } @@ -62,7 +62,7 @@ impl<'d, T: Instance> Spi<'d, T> { let br = Self::compute_baud_rate(pclk, freq.into()); unsafe { - T::regs().cr1().write(|w| { + T::regs().cr1().modify(|w| { w.set_cpha( match config.mode.phase == Phase::CaptureOnSecondTransition { true => spi::vals::Cpha::SECONDEDGE,