2021-12-07 00:28:32 +01:00
|
|
|
#![no_std]
|
|
|
|
#![no_main]
|
|
|
|
#![feature(type_alias_impl_trait)]
|
|
|
|
|
|
|
|
#[path = "../example_common.rs"]
|
|
|
|
mod example_common;
|
|
|
|
use defmt::assert;
|
2022-07-29 21:58:35 +02:00
|
|
|
use embassy_executor::executor::Spawner;
|
|
|
|
use embassy_executor::time::{Duration, Instant, Timer};
|
2021-12-07 00:28:32 +01:00
|
|
|
use example_common::*;
|
|
|
|
|
2022-08-17 18:49:55 +02:00
|
|
|
#[embassy_executor::main]
|
|
|
|
async fn main(_spawner: Spawner) {
|
|
|
|
let _p = embassy_stm32::init(config());
|
2021-12-07 00:28:32 +01:00
|
|
|
info!("Hello World!");
|
|
|
|
|
|
|
|
let start = Instant::now();
|
|
|
|
Timer::after(Duration::from_millis(100)).await;
|
|
|
|
let end = Instant::now();
|
|
|
|
let ms = (end - start).as_millis();
|
|
|
|
info!("slept for {} ms", ms);
|
|
|
|
assert!(ms >= 99);
|
|
|
|
assert!(ms < 110);
|
|
|
|
|
|
|
|
info!("Test OK");
|
|
|
|
cortex_m::asm::bkpt();
|
|
|
|
}
|