1
0
Fork 0
zynq-rs/libsupport_zynq/src/panic.rs

25 lines
661 B
Rust
Raw 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");
}
2024-10-04 17:22:49 +08:00
if let Some(message) = info.message().as_str() {
2019-12-17 07:27:20 +08:00
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 {}
}