embedded-trainings-2020/common/panic-log/src/lib.rs

14 lines
271 B
Rust
Raw Normal View History

2020-06-09 09:52:27 +00:00
#![no_std]
use core::panic::PanicInfo;
use cortex_m::asm;
#[panic_handler]
fn panic(info: &PanicInfo) -> ! {
2021-04-14 10:12:02 +00:00
defmt::error!("{}", defmt::Debug2Format(&info));
2020-06-09 09:52:27 +00:00
// abort instruction: triggers a HardFault exception which causes probe-run to exit
asm::udf()
2020-06-09 09:52:27 +00:00
}