detection of the stop0-2
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
use defmt::*;
|
||||
use embassy_stm32::pac;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_executor::{Spawner, task};
|
||||
use embassy_stm32::Config;
|
||||
use embassy_stm32::gpio::{Output, Level, Speed};
|
||||
use embassy_time::{Duration, Timer};
|
||||
@@ -28,6 +28,9 @@ async fn main(spawner: Spawner) {
|
||||
led.set_high();
|
||||
info!("LED ON (MCU awake)");
|
||||
|
||||
// LED BLINK
|
||||
spawner.spawn(led_blink(led).unwrap());
|
||||
|
||||
// INIT HW UART
|
||||
init_hw_uart_to_pc(p.USART1, p.PA10, p.PA9, &spawner);
|
||||
|
||||
@@ -67,3 +70,11 @@ async fn main(spawner: Spawner) {
|
||||
execute_low_power(cmd, &mut iwdg).await;
|
||||
}
|
||||
}
|
||||
|
||||
#[task]
|
||||
async fn led_blink(mut led: Output<'static>) {
|
||||
loop {
|
||||
led.toggle();
|
||||
Timer::after(Duration::from_millis(300)).await;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user