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

Wait for an interrupt to occur.

This function causes the current CPU core to execute its Wait For Interrupt (WFI or equivalent) instruction. After executing this function, the CPU core will stop execution until an interrupt occurs.

This function will return immediately when a debugger is attached, so it is intended to be called in a loop.

ยง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.