stm32/low-power: refactor refcount
This commit is contained in:
parent
0cc3e18db6
commit
e8a3cfaed6
6 changed files with 29 additions and 35 deletions
tests/stm32/src/bin
|
@ -10,8 +10,8 @@ use chrono::NaiveDate;
|
|||
use common::*;
|
||||
use cortex_m_rt::entry;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_stm32::low_power::{stop_with_rtc, Executor};
|
||||
use embassy_stm32::rcc::{low_power_ready, LsConfig};
|
||||
use embassy_stm32::low_power::{stop_ready, stop_with_rtc, Executor, StopMode};
|
||||
use embassy_stm32::rcc::LsConfig;
|
||||
use embassy_stm32::rtc::{Rtc, RtcConfig};
|
||||
use embassy_stm32::Config;
|
||||
use embassy_time::Timer;
|
||||
|
@ -28,7 +28,7 @@ fn main() -> ! {
|
|||
async fn task_1() {
|
||||
for _ in 0..9 {
|
||||
info!("task 1: waiting for 500ms...");
|
||||
defmt::assert!(low_power_ready());
|
||||
defmt::assert!(stop_ready(StopMode::Stop2));
|
||||
Timer::after_millis(500).await;
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ async fn task_1() {
|
|||
async fn task_2() {
|
||||
for _ in 0..5 {
|
||||
info!("task 2: waiting for 1000ms...");
|
||||
defmt::assert!(low_power_ready());
|
||||
defmt::assert!(stop_ready(StopMode::Stop2));
|
||||
Timer::after_millis(1000).await;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue