aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/std/src/bin/tick.rs13
1 files changed, 4 insertions, 9 deletions
diff --git a/examples/std/src/bin/tick.rs b/examples/std/src/bin/tick.rs
index 385b317d4..7de78040f 100644
--- a/examples/std/src/bin/tick.rs
+++ b/examples/std/src/bin/tick.rs
@@ -1,9 +1,8 @@
1#![feature(type_alias_impl_trait)] 1#![feature(type_alias_impl_trait)]
2#![allow(incomplete_features)] 2#![allow(incomplete_features)]
3 3
4use embassy::executor::Executor; 4use embassy::executor::Spawner;
5use embassy::time::{Duration, Timer}; 5use embassy::time::{Duration, Timer};
6use embassy::util::Forever;
7use log::*; 6use log::*;
8 7
9#[embassy::task] 8#[embassy::task]
@@ -14,16 +13,12 @@ async fn run() {
14 } 13 }
15} 14}
16 15
17static EXECUTOR: Forever<Executor> = Forever::new(); 16#[embassy::main]
18 17async fn main(spawner: Spawner) {
19fn main() {
20 env_logger::builder() 18 env_logger::builder()
21 .filter_level(log::LevelFilter::Debug) 19 .filter_level(log::LevelFilter::Debug)
22 .format_timestamp_nanos() 20 .format_timestamp_nanos()
23 .init(); 21 .init();
24 22
25 let executor = EXECUTOR.put(Executor::new()); 23 spawner.spawn(run()).unwrap();
26 executor.run(|spawner| {
27 spawner.spawn(run()).unwrap();
28 });
29} 24}