Skip to content

Commit 0eaa0de

Browse files
committed
update the minimal example
1 parent 3e39a0b commit 0eaa0de

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

examples/minimal.rs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,6 @@
1515
//! define a panicking behavior is to link to a [panic handler crate][0]
1616
//!
1717
//! [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.
2618
2719
#![no_main] // <- IMPORTANT!
2820
#![no_std]
@@ -47,17 +39,3 @@ fn main() -> ! {
4739
asm::bkpt();
4840
}
4941
}
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-
}

0 commit comments

Comments
 (0)