embedded-trainings-2020/common/panic-log/src/lib.rs
Jorge Aparicio 49a254f8ce use asm::udf in panic-log
to match panic-probe behavior
UDF makes probe-run exit with a non-zero exit code
2021-01-21 14:00:59 +01:00

14 lines
247 B
Rust

#![no_std]
use core::panic::PanicInfo;
use cortex_m::asm;
#[panic_handler]
fn panic(info: &PanicInfo) -> ! {
log::error!("{}", info);
// abort instruction: triggers a HardFault exception which causes probe-run to exit
asm::udf()
}