diff options
| author | Dario Nieuwenhuis <[email protected]> | 2022-08-17 18:49:55 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2022-08-17 22:16:46 +0200 |
| commit | fc6e1e06b305d302d1b7ad17e8ef3a9be986c358 (patch) | |
| tree | 545ad829660f6053d29a01da286d03ec3d49f5ca /examples/stm32h7/src/bin/camera.rs | |
| parent | d881f3ad9186cf3279aa1ba27093bad94035c186 (diff) | |
Remove HAL initialization from #[embassy::main] macro.
Diffstat (limited to 'examples/stm32h7/src/bin/camera.rs')
| -rw-r--r-- | examples/stm32h7/src/bin/camera.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/stm32h7/src/bin/camera.rs b/examples/stm32h7/src/bin/camera.rs index a3bb2d5e2..8e93a54c8 100644 --- a/examples/stm32h7/src/bin/camera.rs +++ b/examples/stm32h7/src/bin/camera.rs | |||
| @@ -9,7 +9,7 @@ use embassy_stm32::gpio::{Level, Output, Speed}; | |||
| 9 | use embassy_stm32::i2c::I2c; | 9 | use embassy_stm32::i2c::I2c; |
| 10 | use embassy_stm32::rcc::{Mco, Mco1Source, McoClock}; | 10 | use embassy_stm32::rcc::{Mco, Mco1Source, McoClock}; |
| 11 | use embassy_stm32::time::{khz, mhz}; | 11 | use embassy_stm32::time::{khz, mhz}; |
| 12 | use embassy_stm32::{interrupt, Config, Peripherals}; | 12 | use embassy_stm32::{interrupt, Config}; |
| 13 | use {defmt_rtt as _, panic_probe as _}; | 13 | use {defmt_rtt as _, panic_probe as _}; |
| 14 | 14 | ||
| 15 | #[allow(unused)] | 15 | #[allow(unused)] |
| @@ -32,8 +32,9 @@ const HEIGHT: usize = 100; | |||
| 32 | 32 | ||
| 33 | static mut FRAME: [u32; WIDTH * HEIGHT / 2] = [0u32; WIDTH * HEIGHT / 2]; | 33 | static mut FRAME: [u32; WIDTH * HEIGHT / 2] = [0u32; WIDTH * HEIGHT / 2]; |
| 34 | 34 | ||
| 35 | #[embassy_executor::main(config = "config()")] | 35 | #[embassy_executor::main] |
| 36 | async fn main(_spawner: Spawner, p: Peripherals) { | 36 | async fn main(_spawner: Spawner) { |
| 37 | let p = embassy_stm32::init(config()); | ||
| 37 | defmt::info!("Hello World!"); | 38 | defmt::info!("Hello World!"); |
| 38 | let mco = Mco::new(p.MCO1, p.PA8, Mco1Source::Hsi, McoClock::Divided(3)); | 39 | let mco = Mco::new(p.MCO1, p.PA8, Mco1Source::Hsi, McoClock::Divided(3)); |
| 39 | 40 | ||
