summaryrefslogtreecommitdiff
path: root/examples/stm32l4/src
diff options
context:
space:
mode:
Diffstat (limited to 'examples/stm32l4/src')
-rw-r--r--examples/stm32l4/src/bin/rng.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/examples/stm32l4/src/bin/rng.rs b/examples/stm32l4/src/bin/rng.rs
index d0e1306a..c9051562 100644
--- a/examples/stm32l4/src/bin/rng.rs
+++ b/examples/stm32l4/src/bin/rng.rs
@@ -9,7 +9,8 @@ use embassy_stm32::rng::Rng;
use embassy_stm32::Config;
use {defmt_rtt as _, panic_probe as _};
-fn config() -> Config {
+#[embassy_executor::main]
+async fn main(_spawner: Spawner) {
let mut config = Config::default();
// 72Mhz clock (16 / 1 * 18 / 4)
config.rcc.mux = ClockSrc::PLL(
@@ -19,12 +20,8 @@ fn config() -> Config {
PLLMul::Mul18,
Some(PLLClkDiv::Div6), // 48Mhz (16 / 1 * 18 / 6)
);
- config
-}
+ let p = embassy_stm32::init(config);
-#[embassy_executor::main]
-async fn main(_spawner: Spawner) {
- let p = embassy_stm32::init(config());
info!("Hello World!");
let mut rng = Rng::new(p.RNG);