aboutsummaryrefslogtreecommitdiff
path: root/src/interrupt.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/interrupt.rs')
-rw-r--r--src/interrupt.rs12
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");
+}