zynq-rs/libsupport_zynq/src/panic.rs

20 lines
511 B
Rust
Raw Normal View History

use libboard_zynq::{slcr, print, println};
2019-11-11 09:37:06 +08:00
#[panic_handler]
fn panic(info: &core::panic::PanicInfo) -> ! {
2019-12-17 07:27:20 +08:00
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!("");
}
2019-11-11 09:37:06 +08:00
slcr::RegisterBlock::unlocked(|slcr| slcr.soft_reset());
2019-11-11 09:37:06 +08:00
loop {}
}