Skip to main content

wait_for_interrupt

Function wait_for_interrupt 

Source
pub fn wait_for_interrupt()
Available on crate feature unstable only.
Expand description

Waits for an interrupt to occur.

Causes the current CPU core to execute its Wait For Interrupt (WFI or equivalent) instruction. After this call, the CPU core stops execution until an interrupt occurs.

Returns immediately when a debugger is attached; intended to be called in a loop.

When the ESP_HAL_CONFIG_IDLE_FREQUENCY_SCALING option is enabled, the CPU clock comes from XTAL_CLK while the CPU waits. See CpuFrequencyLock.

ยงStability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.