Skip to content

Cleanup free functions #642

@wt

Description

@wt

My asm refactor allows us to get rid of

// Make a `free()` function available on hosted platforms to allow checking dependencies without
// specifying a target, but that will panic at runtime if executed.
/// Execute closure `f` in an interrupt-free context.
///
/// This as also known as a "critical section".
#[cfg(not(cortex_m))]
#[inline]
pub fn free<F, R>(_: F) -> R
where
F: FnOnce(&CriticalSection) -> R,
{
panic!("cortex_m::interrupt::free() is only functional on cortex-m platforms");
}
and remove the cfg guard from the normal free function.

The normal free function is already compileable on non-cortex-m because it relies on functions that will simply call unimplemented!() if they are built on unsupported targets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions