diff options
Diffstat (limited to 'src/interrupt.rs')
-rw-r--r-- | src/interrupt.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/interrupt.rs b/src/interrupt.rs index 06b91f1..72450c4 100644 --- a/src/interrupt.rs +++ b/src/interrupt.rs @@ -77,3 +77,15 @@ where r } + +// Make a `free()` function available to allow checking dependencies without specifying a target, +// but that will panic at runtime if executed. +#[doc(hidden)] +#[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"); +} |