aboutsummaryrefslogtreecommitdiff
path: root/cortex-m-rt/examples/unsafe-hard-fault.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cortex-m-rt/examples/unsafe-hard-fault.rs')
-rw-r--r--cortex-m-rt/examples/unsafe-hard-fault.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/cortex-m-rt/examples/unsafe-hard-fault.rs b/cortex-m-rt/examples/unsafe-hard-fault.rs
new file mode 100644
index 0000000..b091d47
--- /dev/null
+++ b/cortex-m-rt/examples/unsafe-hard-fault.rs
@@ -0,0 +1,18 @@
+#![deny(warnings)]
+#![no_main]
+#![no_std]
+
+extern crate cortex_m_rt;
+extern crate panic_semihosting;
+
+use cortex_m_rt::{entry, exception, ExceptionFrame};
+
+#[entry]
+fn foo() -> ! {
+ loop {}
+}
+
+#[exception]
+unsafe fn HardFault(_ef: &ExceptionFrame) -> ! {
+ loop {}
+}