2021-02-03 05:05:05 +01:00
|
|
|
#![feature(type_alias_impl_trait)]
|
|
|
|
|
2021-09-02 14:45:20 +02:00
|
|
|
use embassy::executor::Spawner;
|
2021-02-03 05:05:05 +01:00
|
|
|
use embassy::time::{Duration, Timer};
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-02 14:45:20 +02:00
|
|
|
#[embassy::main]
|
|
|
|
async fn main(spawner: Spawner) {
|
2021-02-03 05:05:05 +01:00
|
|
|
env_logger::builder()
|
|
|
|
.filter_level(log::LevelFilter::Debug)
|
|
|
|
.format_timestamp_nanos()
|
|
|
|
.init();
|
|
|
|
|
2021-09-02 14:45:20 +02:00
|
|
|
spawner.spawn(run()).unwrap();
|
2021-02-03 05:05:05 +01:00
|
|
|
}
|