mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-17 08:40:52 +00:00
make the LCD panic handler Precursor-specific
This commit is contained in:
parent
2903de5b7b
commit
344dd5094b
1 changed files with 21 additions and 18 deletions
|
|
@ -5,24 +5,27 @@ use core::panic::PanicInfo;
|
|||
#[panic_handler]
|
||||
fn handle_panic(_arg: &PanicInfo) -> ! {
|
||||
println!("PANIC in PID {}: {}", crate::arch::current_pid(), _arg);
|
||||
use crate::platform::precursor::lcdpanic::ErrorWriter;
|
||||
use core::fmt::Write;
|
||||
if let Ok(mut writer) = ErrorWriter::new() {
|
||||
writeln!(
|
||||
writer,
|
||||
"PANIC in PID {}: {}",
|
||||
crate::arch::current_pid(),
|
||||
_arg
|
||||
)
|
||||
.ok();
|
||||
let process = crate::arch::process::Process::current();
|
||||
writeln!(writer, "Current thread: {}", process.current_tid()).ok();
|
||||
writeln!(
|
||||
writer,
|
||||
"{}",
|
||||
crate::arch::process::Process::current().current_thread()
|
||||
)
|
||||
.ok();
|
||||
#[cfg(any(feature = "precursor", feature = "renode"))]
|
||||
{
|
||||
use crate::platform::precursor::lcdpanic::ErrorWriter;
|
||||
use core::fmt::Write;
|
||||
if let Ok(mut writer) = ErrorWriter::new() {
|
||||
writeln!(
|
||||
writer,
|
||||
"PANIC in PID {}: {}",
|
||||
crate::arch::current_pid(),
|
||||
_arg
|
||||
)
|
||||
.ok();
|
||||
let process = crate::arch::process::Process::current();
|
||||
writeln!(writer, "Current thread: {}", process.current_tid()).ok();
|
||||
writeln!(
|
||||
writer,
|
||||
"{}",
|
||||
crate::arch::process::Process::current().current_thread()
|
||||
)
|
||||
.ok();
|
||||
}
|
||||
}
|
||||
loop {
|
||||
arch::idle();
|
||||
|
|
|
|||
Loading…
Reference in a new issue