Function esp32c3_hal::riscv::interrupt::free

pub fn free<F, R>(f: F) -> Rwhere
    F: FnOnce() -> R,
Expand description

Execute closure f with interrupts disabled in the current hart.

This method does not synchronise multiple harts, so it is not suitable for using as a critical section. See the critical-section crate for a cross-platform way to enter a critical section which provides a CriticalSection token.

This crate provides an implementation for critical-section suitable for single-hart systems, based on disabling all interrupts. It can be enabled with the critical-section-single-hart feature.