aboutsummaryrefslogtreecommitdiff
path: root/docs/modules/ROOT/examples/basic/src/main.rs
diff options
context:
space:
mode:
authorQuentin Smith <[email protected]>2022-08-19 00:53:06 -0400
committerQuentin Smith <[email protected]>2022-08-19 00:53:41 -0400
commit71e468681b1c074e06276d34ff00e36169c632f5 (patch)
treece86220caabbdc044720df8efb23de7bc4c36ea0 /docs/modules/ROOT/examples/basic/src/main.rs
parent2edf532f8d8ce048137990bf74b07759428ed7c1 (diff)
parentaefa5275a2ab2cac6caef599e7adb76ce1beeddd (diff)
Merge branch 'master' of https://github.com/embassy-rs/embassy into rtos-trace
Diffstat (limited to 'docs/modules/ROOT/examples/basic/src/main.rs')
-rw-r--r--docs/modules/ROOT/examples/basic/src/main.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/docs/modules/ROOT/examples/basic/src/main.rs b/docs/modules/ROOT/examples/basic/src/main.rs
index cec39fd91..04170db55 100644
--- a/docs/modules/ROOT/examples/basic/src/main.rs
+++ b/docs/modules/ROOT/examples/basic/src/main.rs
@@ -3,11 +3,10 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy_executor::executor::Spawner; 6use embassy_executor::Spawner;
7use embassy_executor::time::{Duration, Timer};
8use embassy_nrf::gpio::{Level, Output, OutputDrive}; 7use embassy_nrf::gpio::{Level, Output, OutputDrive};
9use embassy_nrf::peripherals::P0_13; 8use embassy_nrf::peripherals::P0_13;
10use embassy_nrf::Peripherals; 9use embassy_time::{Duration, Timer};
11use {defmt_rtt as _, panic_probe as _}; // global logger 10use {defmt_rtt as _, panic_probe as _}; // global logger
12 11
13#[embassy_executor::task] 12#[embassy_executor::task]
@@ -21,7 +20,9 @@ async fn blinker(mut led: Output<'static, P0_13>, interval: Duration) {
21} 20}
22 21
23#[embassy_executor::main] 22#[embassy_executor::main]
24async fn main(spawner: Spawner, p: Peripherals) { 23async fn main(spawner: Spawner) {
24 let p = embassy_nrf::init(Default::default());
25
25 let led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard); 26 let led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard);
26 unwrap!(spawner.spawn(blinker(led, Duration::from_millis(300)))); 27 unwrap!(spawner.spawn(blinker(led, Duration::from_millis(300))));
27} 28}