diff options
| author | Dario Nieuwenhuis <[email protected]> | 2022-08-17 22:25:58 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2022-08-17 22:25:58 +0200 |
| commit | 2e85eaf7d5f4dcf6d84f426542b8ec87aa51c429 (patch) | |
| tree | 1d22c32eae26435677df89083d71f50fc298a09f /examples/stm32h7/src/bin/eth_client.rs | |
| parent | fc6e1e06b305d302d1b7ad17e8ef3a9be986c358 (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_client.rs')
| -rw-r--r-- | examples/stm32h7/src/bin/eth_client.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/examples/stm32h7/src/bin/eth_client.rs b/examples/stm32h7/src/bin/eth_client.rs index 736a2992e..25e75d71e 100644 --- a/examples/stm32h7/src/bin/eth_client.rs +++ b/examples/stm32h7/src/bin/eth_client.rs | |||
| @@ -34,17 +34,13 @@ async fn net_task(stack: &'static Stack<Device>) -> ! { | |||
| 34 | stack.run().await | 34 | stack.run().await |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | pub fn config() -> Config { | 37 | #[embassy_executor::main] |
| 38 | async fn main(spawner: Spawner) -> ! { | ||
| 38 | let mut config = Config::default(); | 39 | let mut config = Config::default(); |
| 39 | config.rcc.sys_ck = Some(mhz(400)); | 40 | config.rcc.sys_ck = Some(mhz(400)); |
| 40 | config.rcc.hclk = Some(mhz(200)); | 41 | config.rcc.hclk = Some(mhz(200)); |
| 41 | config.rcc.pll1.q_ck = Some(mhz(100)); | 42 | config.rcc.pll1.q_ck = Some(mhz(100)); |
| 42 | config | 43 | let p = embassy_stm32::init(config); |
| 43 | } | ||
| 44 | |||
| 45 | #[embassy_executor::main] | ||
| 46 | async fn main(spawner: Spawner) -> ! { | ||
| 47 | let p = embassy_stm32::init(config()); | ||
| 48 | info!("Hello World!"); | 44 | info!("Hello World!"); |
| 49 | 45 | ||
| 50 | // Generate random seed. | 46 | // Generate random seed. |
