From 9ea3ee6461b751637c88cd9cde92728ff77e472e Mon Sep 17 00:00:00 2001 From: Andelf Date: Fri, 20 Dec 2024 10:55:54 +0800 Subject: [PATCH] fix(demo): fix spi config usage --- examples/hpm5300evk/src/bin/qspi.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/examples/hpm5300evk/src/bin/qspi.rs b/examples/hpm5300evk/src/bin/qspi.rs index 2db0664..f56d645 100644 --- a/examples/hpm5300evk/src/bin/qspi.rs +++ b/examples/hpm5300evk/src/bin/qspi.rs @@ -282,14 +282,12 @@ fn main() -> ! { // PA10 let mut led = Output::new(p.PA10, Level::Low, Speed::Fast); - let spi_config = Config { - frequency: Hertz(40_000_000), - mode: MODE_0, - timing: Timings { - cs2sclk: hpm_hal::spi::Cs2Sclk::_1HalfSclk, - csht: hpm_hal::spi::CsHighTime::_8HalfSclk, - }, - ..Default::default() + let mut spi_config = Config::default(); + spi_config.frequency = Hertz(40_000_000); + spi_config.mode = MODE_0; + spi_config.timing = Timings { + cs2sclk: hpm_hal::spi::Cs2Sclk::_1HalfSclk, + csht: hpm_hal::spi::CsHighTime::_8HalfSclk, }; let spi: hal::spi::Spi<'_, Blocking> =