2021-02-03 05:05:05 +01:00
|
|
|
#![feature(type_alias_impl_trait)]
|
2021-05-18 14:11:20 +02:00
|
|
|
#![allow(incomplete_features)]
|
2021-02-03 05:05:05 +01:00
|
|
|
|
2021-08-25 20:34:25 +02:00
|
|
|
use embassy::executor::Executor;
|
2021-02-03 05:05:05 +01:00
|
|
|
use embassy::time::{Duration, Timer};
|
|
|
|
use embassy::util::Forever;
|
|
|
|
use log::*;
|
|
|
|
|
2021-03-29 03:00:48 +02:00
|
|
|
#[embassy::task]
|
2021-02-03 05:05:05 +01:00
|
|
|
async fn run() {
|
|
|
|
loop {
|
|
|
|
info!("tick");
|
|
|
|
Timer::after(Duration::from_secs(1)).await;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static EXECUTOR: Forever<Executor> = Forever::new();
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
env_logger::builder()
|
|
|
|
.filter_level(log::LevelFilter::Debug)
|
|
|
|
.format_timestamp_nanos()
|
|
|
|
.init();
|
|
|
|
|
|
|
|
let executor = EXECUTOR.put(Executor::new());
|
|
|
|
executor.run(|spawner| {
|
|
|
|
spawner.spawn(run()).unwrap();
|
|
|
|
});
|
|
|
|
}
|