2021-06-09 13:22:52 +00:00
|
|
|
#![no_std]
|
|
|
|
#![no_main]
|
|
|
|
#![feature(type_alias_impl_trait)]
|
|
|
|
|
2022-04-02 02:35:06 +00:00
|
|
|
use defmt_rtt as _; // global logger
|
|
|
|
use panic_probe as _;
|
2021-07-29 14:01:08 +00:00
|
|
|
|
2022-04-02 02:35:06 +00:00
|
|
|
use defmt::*;
|
2021-07-29 14:01:08 +00:00
|
|
|
use embassy::executor::Spawner;
|
|
|
|
use embassy::time::{Duration, Timer};
|
|
|
|
use embassy_stm32::gpio::{Level, Output, Speed};
|
|
|
|
use embassy_stm32::Peripherals;
|
2021-06-09 13:22:52 +00:00
|
|
|
|
2021-07-29 14:01:08 +00:00
|
|
|
#[embassy::main]
|
2021-08-19 21:32:22 +00:00
|
|
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
2021-06-09 13:22:52 +00:00
|
|
|
info!("Hello World!");
|
|
|
|
|
2021-06-25 20:32:24 +00:00
|
|
|
let mut led = Output::new(p.PB5, Level::High, Speed::Low);
|
2021-06-09 13:22:52 +00:00
|
|
|
|
|
|
|
loop {
|
|
|
|
info!("high");
|
2022-01-14 21:02:00 +00:00
|
|
|
led.set_high();
|
2021-07-29 14:01:08 +00:00
|
|
|
Timer::after(Duration::from_millis(300)).await;
|
2021-06-09 13:22:52 +00:00
|
|
|
|
|
|
|
info!("low");
|
2022-01-14 21:02:00 +00:00
|
|
|
led.set_low();
|
2021-07-29 14:01:08 +00:00
|
|
|
Timer::after(Duration::from_millis(300)).await;
|
2021-06-09 13:22:52 +00:00
|
|
|
}
|
|
|
|
}
|