#[non_exhaustive]pub enum CoreSleep {
WfeUngated,
WfeGated,
DeepSleep,
}Expand description
Maximum sleep depth for the CPU core
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
WfeUngated
System will sleep using WFE when idle, but the CPU clock domain will not ever be gated. This mode uses the most power, but allows for debugging to continue uninterrupted.
With this setting, the system never leaves the “Active” configuration mode.
WfeGated
The system will sleep using WFE when idle, and the CPU clock domain will be be gated. If configured with FlashSleep, the internal flash may be gated as well.
§WARNING
Enabling this mode has potential danger to soft-lock the system!
- This mode WILL detach the debugging/RTT/defmt session if active upon first sleep.
- This mode WILL also require ISP mode recovery in order to re-flash if the core becomes “stuck” in sleep.
DeepSleep
The system will go to deep sleep when idle, and the CPU clock domain will be be gated. If configured with FlashSleep, the internal flash may be gated as well.
This will also move the system into the “low power” state, which will disable any clocks not configured as `PoweredClock::AlwaysActive“.
§TODO
For now, this REQUIRES calling unsafe okay_but_actually_enable_deep_sleep()
otherwise we’d ALWAYS go to deep sleep on every WFE. We need to implement a
custom executor that does proper go-to-deepsleep and come-back-from-deepsleep
before un-chickening this. If the method isn’t called, we just set to WfeGated
instead.
§WARNING
Enabling this mode has potential danger to soft-lock the system!
- This mode WILL detach the debugging/RTT/defmt session if active upon first sleep.
- This mode WILL also require ISP mode recovery in order to re-flash if the core becomes “stuck” in sleep.