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/rp/src/bin/gpio_async.rs | |
| parent | d881f3ad9186cf3279aa1ba27093bad94035c186 (diff) | |
Remove HAL initialization from #[embassy::main] macro.
Diffstat (limited to 'examples/rp/src/bin/gpio_async.rs')
| -rw-r--r-- | examples/rp/src/bin/gpio_async.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/rp/src/bin/gpio_async.rs b/examples/rp/src/bin/gpio_async.rs index ba905b015..c61b87a38 100644 --- a/examples/rp/src/bin/gpio_async.rs +++ b/examples/rp/src/bin/gpio_async.rs | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | use defmt::*; | 5 | use defmt::*; |
| 6 | use embassy_executor::executor::Spawner; | 6 | use embassy_executor::executor::Spawner; |
| 7 | use embassy_executor::time::{Duration, Timer}; | 7 | use embassy_executor::time::{Duration, Timer}; |
| 8 | use embassy_rp::{gpio, Peripherals}; | 8 | use embassy_rp::gpio; |
| 9 | use gpio::{Input, Level, Output, Pull}; | 9 | use gpio::{Input, Level, Output, Pull}; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| @@ -20,7 +20,8 @@ use {defmt_rtt as _, panic_probe as _}; | |||
| 20 | /// continue and turn off the LED, and then wait for 2 seconds before completing | 20 | /// continue and turn off the LED, and then wait for 2 seconds before completing |
| 21 | /// the loop and starting over again. | 21 | /// the loop and starting over again. |
| 22 | #[embassy_executor::main] | 22 | #[embassy_executor::main] |
| 23 | async fn main(_spawner: Spawner, p: Peripherals) { | 23 | async fn main(_spawner: Spawner) { |
| 24 | let p = embassy_rp::init(Default::default()); | ||
| 24 | let mut led = Output::new(p.PIN_25, Level::Low); | 25 | let mut led = Output::new(p.PIN_25, Level::Low); |
| 25 | let mut async_input = Input::new(p.PIN_16, Pull::None); | 26 | let mut async_input = Input::new(p.PIN_16, Pull::None); |
| 26 | 27 | ||
