aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--cortex-m-rt/examples/divergent-default-handler.rs3
-rw-r--r--cortex-m-rt/examples/override-exception.rs5
2 files changed, 3 insertions, 5 deletions
diff --git a/cortex-m-rt/examples/divergent-default-handler.rs b/cortex-m-rt/examples/divergent-default-handler.rs
index 22fa437..3290254 100644
--- a/cortex-m-rt/examples/divergent-default-handler.rs
+++ b/cortex-m-rt/examples/divergent-default-handler.rs
@@ -1,4 +1,3 @@
-#![deny(unsafe_code)]
#![deny(warnings)]
#![no_main]
#![no_std]
@@ -14,6 +13,6 @@ fn foo() -> ! {
}
#[exception]
-fn DefaultHandler(_irqn: i16) -> ! {
+unsafe fn DefaultHandler(_irqn: i16) -> ! {
loop {}
}
diff --git a/cortex-m-rt/examples/override-exception.rs b/cortex-m-rt/examples/override-exception.rs
index 6da6c5e..3190b77 100644
--- a/cortex-m-rt/examples/override-exception.rs
+++ b/cortex-m-rt/examples/override-exception.rs
@@ -1,6 +1,5 @@
//! How to override the hard fault exception handler and the default exception handler
-#![deny(unsafe_code)]
#![deny(warnings)]
#![no_main]
#![no_std]
@@ -18,12 +17,12 @@ fn main() -> ! {
}
#[exception]
-fn DefaultHandler(_irqn: i16) {
+unsafe fn DefaultHandler(_irqn: i16) {
asm::bkpt();
}
#[exception]
-fn HardFault(_ef: &ExceptionFrame) -> ! {
+unsafe fn HardFault(_ef: &ExceptionFrame) -> ! {
asm::bkpt();
loop {}