Skip to content

Commit 949ba7b

Browse files
Fix compilation of examples with fault handlers (#119)
These handlers have been unsafe since cortex-m-rt version 0.7.0.
1 parent d0c58e9 commit 949ba7b

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

examples/blinky_random.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![deny(warnings)]
2-
#![deny(unsafe_code)]
32
#![no_main]
43
#![no_std]
54

@@ -46,7 +45,7 @@ fn main() -> ! {
4645

4746
#[allow(clippy::empty_loop)]
4847
#[exception]
49-
fn HardFault(ef: &ExceptionFrame) -> ! {
48+
unsafe fn HardFault(ef: &ExceptionFrame) -> ! {
5049
hprintln!("Hard fault {:#?}", ef).unwrap();
5150
loop {}
5251
}

examples/pwm.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![deny(warnings)]
2-
#![deny(unsafe_code)]
32
#![no_main]
43
#![no_std]
54

@@ -47,11 +46,11 @@ fn main() -> ! {
4746
}
4847

4948
#[exception]
50-
fn HardFault(ef: &ExceptionFrame) -> ! {
49+
unsafe fn HardFault(ef: &ExceptionFrame) -> ! {
5150
panic!("Hard fault {:#?}", ef);
5251
}
5352

5453
#[exception]
55-
fn DefaultHandler(irqn: i16) {
54+
unsafe fn DefaultHandler(irqn: i16) {
5655
panic!("Unhandled exception (IRQn = {})", irqn);
5756
}

examples/watchdog.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![deny(warnings)]
2-
#![deny(unsafe_code)]
32
#![no_main]
43
#![no_std]
54

@@ -38,6 +37,6 @@ fn main() -> ! {
3837
}
3938

4039
#[exception]
41-
fn HardFault(ef: &ExceptionFrame) -> ! {
40+
unsafe fn HardFault(ef: &ExceptionFrame) -> ! {
4241
panic!("Hard fault {:#?}", ef);
4342
}

0 commit comments

Comments
 (0)