File tree 1 file changed +0
-22
lines changed
1 file changed +0
-22
lines changed Original file line number Diff line number Diff line change 15
15
//! define a panicking behavior is to link to a [panic handler crate][0]
16
16
//!
17
17
//! [0]: https://crates.io/keywords/panic-impl
18
- //!
19
- //! - Define the `HardFault` handler using the [`exception!`] macro. This handler (function) is
20
- //! called when a hard fault exception is raised by the hardware.
21
- //!
22
- //! [`exception!`]: https://docs.rs/cortex-m-rt/~0.5/cortex_m_rt/macro..html
23
- //!
24
- //! - Define a default handler using the [`exception!`] macro. This function will be used to handle
25
- //! all interrupts and exceptions which have not been assigned a specific handler.
26
18
27
19
#![ no_main] // <- IMPORTANT!
28
20
#![ no_std]
@@ -47,17 +39,3 @@ fn main() -> ! {
47
39
asm:: bkpt ( ) ;
48
40
}
49
41
}
50
-
51
- // define the hard fault handler
52
- exception ! ( HardFault , hard_fault) ;
53
-
54
- fn hard_fault ( ef : & ExceptionFrame ) -> ! {
55
- panic ! ( "HardFault at {:#?}" , ef) ;
56
- }
57
-
58
- // define the default exception handler
59
- exception ! ( * , default_handler) ;
60
-
61
- fn default_handler ( irqn : i16 ) {
62
- panic ! ( "Unhandled exception (IRQn = {})" , irqn) ;
63
- }
You can’t perform that action at this time.
0 commit comments