aboutsummaryrefslogtreecommitdiff
path: root/examples/rp/src/bin/gpio_async.rs
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2022-08-17 18:49:55 +0200
committerDario Nieuwenhuis <[email protected]>2022-08-17 22:16:46 +0200
commitfc6e1e06b305d302d1b7ad17e8ef3a9be986c358 (patch)
tree545ad829660f6053d29a01da286d03ec3d49f5ca /examples/rp/src/bin/gpio_async.rs
parentd881f3ad9186cf3279aa1ba27093bad94035c186 (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.rs5
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 @@
5use defmt::*; 5use defmt::*;
6use embassy_executor::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_executor::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_rp::{gpio, Peripherals}; 8use embassy_rp::gpio;
9use gpio::{Input, Level, Output, Pull}; 9use gpio::{Input, Level, Output, Pull};
10use {defmt_rtt as _, panic_probe as _}; 10use {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]
23async fn main(_spawner: Spawner, p: Peripherals) { 23async 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