From 75374ce7e853143fdc16bd194342e6ef8bcac513 Mon Sep 17 00:00:00 2001 From: Grant Miller Date: Mon, 6 Dec 2021 14:57:53 -0600 Subject: [PATCH] Fix ssoe in v1 --- embassy-stm32/src/spi/v1.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/embassy-stm32/src/spi/v1.rs b/embassy-stm32/src/spi/v1.rs index d7075dc4..1b870c2d 100644 --- a/embassy-stm32/src/spi/v1.rs +++ b/embassy-stm32/src/spi/v1.rs @@ -52,18 +52,15 @@ impl<'d, T: Instance, Tx, Rx> Spi<'d, T, Tx, Rx> { miso.as_ref().map(|x| x.set_as_af(miso_af, AFType::Input)); } - unsafe { - T::regs().cr2().modify(|w| { - w.set_ssoe(false); - }); - } - let pclk = T::frequency(); let br = Self::compute_baud_rate(pclk, freq.into()); unsafe { T::enable(); T::reset(); + T::regs().cr2().modify(|w| { + w.set_ssoe(false); + }); T::regs().cr1().modify(|w| { w.set_cpha( match config.mode.phase == Phase::CaptureOnSecondTransition {