aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32h7/src/bin/eth.rs
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2022-08-17 22:25:58 +0200
committerDario Nieuwenhuis <[email protected]>2022-08-17 22:25:58 +0200
commit2e85eaf7d5f4dcf6d84f426542b8ec87aa51c429 (patch)
tree1d22c32eae26435677df89083d71f50fc298a09f /examples/stm32h7/src/bin/eth.rs
parentfc6e1e06b305d302d1b7ad17e8ef3a9be986c358 (diff)
examples Remove the `fn config()` idiom.
It was only useful for doing #[embassy_executor::main(config = "config()")]`. Now that it's gone, it makes more sense to build the config in main directly.
Diffstat (limited to 'examples/stm32h7/src/bin/eth.rs')
-rw-r--r--examples/stm32h7/src/bin/eth.rs10
1 files changed, 3 insertions, 7 deletions
diff --git a/examples/stm32h7/src/bin/eth.rs b/examples/stm32h7/src/bin/eth.rs
index 7ad2f52c7..9039b7ee7 100644
--- a/examples/stm32h7/src/bin/eth.rs
+++ b/examples/stm32h7/src/bin/eth.rs
@@ -33,17 +33,13 @@ async fn net_task(stack: &'static Stack<Device>) -> ! {
33 stack.run().await 33 stack.run().await
34} 34}
35 35
36pub fn config() -> Config { 36#[embassy_executor::main]
37async fn main(spawner: Spawner) -> ! {
37 let mut config = Config::default(); 38 let mut config = Config::default();
38 config.rcc.sys_ck = Some(mhz(400)); 39 config.rcc.sys_ck = Some(mhz(400));
39 config.rcc.hclk = Some(mhz(200)); 40 config.rcc.hclk = Some(mhz(200));
40 config.rcc.pll1.q_ck = Some(mhz(100)); 41 config.rcc.pll1.q_ck = Some(mhz(100));
41 config 42 let p = embassy_stm32::init(config);
42}
43
44#[embassy_executor::main]
45async fn main(spawner: Spawner) -> ! {
46 let p = embassy_stm32::init(config());
47 info!("Hello World!"); 43 info!("Hello World!");
48 44
49 // Generate random seed. 45 // Generate random seed.