embassy-mcxa

Crates

git

Versions

mcx-a256

Flavors

deep_sleep_if_possible

Function deep_sleep_if_possible 

Source
pub unsafe fn deep_sleep_if_possible(cs: &CriticalSection<'_>) -> bool
Expand description

Attempt to go to deep sleep if possible.

If we successfully went and returned from deep sleep, this function returns a true. If we were unsuccessful due to active WaitGuards, this function returns a false.

ยงSAFETY

Care must be taken that we have ensured that the system is ready to go to deep sleep, otherwise HAL peripherals may misbehave. crate::clocks::init() must have been called and returned successfully, with a CoreSleep configuration set to DeepSleep (or lower).