Function stm32wlxx_hal::pwr::enable_shutdown_sleeponexit
source · pub fn enable_shutdown_sleeponexit(pwr: &mut PWR, scb: &mut SCB)
Expand description
Enable shutdown on return from ISR or the next WFI or WFE.
Example
use stm32wlxx_hal::{pac, pwr::enable_shutdown_sleeponexit};
let mut dp: pac::Peripherals = pac::Peripherals::take().unwrap();
let mut cp: pac::CorePeripherals = pac::CorePeripherals::take().unwrap();
// SLEEPDEEP is implemented with retention
// generally you will want to clear this at power-on when using shutdown
cp.SCB.clear_sleepdeep();
// ... do things
enable_shutdown_sleeponexit(&mut dp.PWR, &mut cp.SCB);