Skip to content

Commit bb868f4

Browse files
Fix examples
1 parent c3851d8 commit bb868f4

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

cortex-m-rt/examples/divergent-default-handler.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![deny(unsafe_code)]
21
#![deny(warnings)]
32
#![no_main]
43
#![no_std]
@@ -14,6 +13,6 @@ fn foo() -> ! {
1413
}
1514

1615
#[exception]
17-
fn DefaultHandler(_irqn: i16) -> ! {
16+
unsafe fn DefaultHandler(_irqn: i16) -> ! {
1817
loop {}
1918
}

cortex-m-rt/examples/override-exception.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! How to override the hard fault exception handler and the default exception handler
22
3-
#![deny(unsafe_code)]
43
#![deny(warnings)]
54
#![no_main]
65
#![no_std]
@@ -18,12 +17,12 @@ fn main() -> ! {
1817
}
1918

2019
#[exception]
21-
fn DefaultHandler(_irqn: i16) {
20+
unsafe fn DefaultHandler(_irqn: i16) {
2221
asm::bkpt();
2322
}
2423

2524
#[exception]
26-
fn HardFault(_ef: &ExceptionFrame) -> ! {
25+
unsafe fn HardFault(_ef: &ExceptionFrame) -> ! {
2726
asm::bkpt();
2827

2928
loop {}

0 commit comments

Comments
 (0)