blob: 3190b77d592dc99d279c1e4539855a77f08a35d4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
//! How to override the hard fault exception handler and the default exception handler
#![deny(warnings)]
#![no_main]
#![no_std]
extern crate cortex_m;
extern crate cortex_m_rt as rt;
extern crate panic_halt;
use cortex_m::asm;
use rt::{entry, exception, ExceptionFrame};
#[entry]
fn main() -> ! {
loop {}
}
#[exception]
unsafe fn DefaultHandler(_irqn: i16) {
asm::bkpt();
}
#[exception]
unsafe fn HardFault(_ef: &ExceptionFrame) -> ! {
asm::bkpt();
loop {}
}
|