diff options
Diffstat (limited to 'examples/stm32h7/src/bin/spi_dma.rs')
-rw-r--r-- | examples/stm32h7/src/bin/spi_dma.rs | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/examples/stm32h7/src/bin/spi_dma.rs b/examples/stm32h7/src/bin/spi_dma.rs index 2631ed30..d4c91a8e 100644 --- a/examples/stm32h7/src/bin/spi_dma.rs +++ b/examples/stm32h7/src/bin/spi_dma.rs @@ -15,14 +15,6 @@ use embassy_util::Forever; use heapless::String; use {defmt_rtt as _, panic_probe as _}; -pub fn config() -> Config { - let mut config = Config::default(); - config.rcc.sys_ck = Some(mhz(400)); - config.rcc.hclk = Some(mhz(200)); - config.rcc.pll1.q_ck = Some(mhz(100)); - config -} - #[embassy_executor::task] async fn main_task(mut spi: spi::Spi<'static, SPI3, DMA1_CH3, DMA1_CH4>) { for n in 0u32.. { @@ -41,7 +33,11 @@ static EXECUTOR: Forever<Executor> = Forever::new(); fn main() -> ! { info!("Hello World!"); - let p = embassy_stm32::init(config()); + let mut config = Config::default(); + config.rcc.sys_ck = Some(mhz(400)); + config.rcc.hclk = Some(mhz(200)); + config.rcc.pll1.q_ck = Some(mhz(100)); + let p = embassy_stm32::init(config); let spi = spi::Spi::new( p.SPI3, |