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.
My asm refactor allows us to get rid of
cortex-m/cortex-m/src/interrupt.rs
Lines 90 to 102 in 6baaf6a
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.