mirror of
https://github.com/ferrous-systems/embedded-trainings-2020.git
synced 2024-05-18 00:12:56 +00:00
49a254f8ce
to match panic-probe behavior UDF makes probe-run exit with a non-zero exit code
14 lines
247 B
Rust
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()
|
|
}
|