zynq-rs/libsupport_zynq/src/panic.rs
2020-01-30 22:54:48 +01:00

20 lines
511 B
Rust

use libboard_zynq::{slcr, print, println};
#[panic_handler]
fn panic(info: &core::panic::PanicInfo) -> ! {
print!("panic at ");
if let Some(location) = info.location() {
print!("{}:{}:{}", location.file(), location.line(), location.column());
} else {
print!("unknown location");
}
if let Some(message) = info.message() {
println!(": {}", message);
} else {
println!("");
}
slcr::RegisterBlock::unlocked(|slcr| slcr.soft_reset());
loop {}
}