zynq-rs/libsupport_zynq/src/panic.rs

25 lines
652 B
Rust
Raw Permalink Normal View History

2020-07-06 21:03:36 +08:00
use libboard_zynq::{print, println};
2022-08-26 11:44:55 +08:00
#[cfg(feature = "target_kasli_soc")]
use libboard_zynq::error_led::ErrorLED;
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!("");
}
2022-08-26 11:44:55 +08:00
#[cfg(feature = "target_kasli_soc")]
{
let mut err_led = ErrorLED::error_led();
err_led.toggle(true);
}
2019-11-11 09:37:06 +08:00
loop {}
}