implementation of stops and reorganization of the codebase

This commit is contained in:
Priec
2025-12-12 22:25:36 +01:00
parent 72a731abef
commit 2c9433cb84
6 changed files with 156 additions and 128 deletions

View File

@@ -0,0 +1,35 @@
use crate::sleep::stop::StopEntry;
use crate::sleep::stop::*;
use crate::hw_uart_pc::init::{LowPowerCmd, StopMode, StopModeConfig};
use defmt::info;
pub fn execute_low_power(cmd: LowPowerCmd) -> ! {
match cmd {
LowPowerCmd::Standby8k => {
info!("Entering Standby with 8KB SRAM2 retention");
// call your existing standby function here
super::standby::enter_standby_with_sram2_8kb();
}
LowPowerCmd::StandbyFull => {
info!("Entering Standby with full SRAM2 retention");
super::standby::enter_standby_with_sram2_full();
}
LowPowerCmd::Standby => {
info!("Entering minimal Standby");
super::standby::enter_standby();
}
LowPowerCmd::Shutdown => {
info!("Entering Shutdown mode");
super::shutdown::enter_shutdown();
}
LowPowerCmd::StopMode(StopModeConfig { mode, entry }) => {
info!("Entering {:?} with {:?}", mode, entry);
match mode {
StopMode::Stop1 => enter_stop1(entry),
StopMode::Stop2 => enter_stop2(entry),
StopMode::Stop3 => enter_stop3(entry),
}
}
}
}