From 5d2c65cb6c271e85852da91a27a3dea2e915c182 Mon Sep 17 00:00:00 2001 From: bunnie Date: Sun, 10 Apr 2022 16:57:04 +0800 Subject: [PATCH] fix missing update to display in panic handler --- services/graphics-server/src/panic.rs | 11 +---------- services/shellchat/src/cmds/test.rs | 3 +++ 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/services/graphics-server/src/panic.rs b/services/graphics-server/src/panic.rs index 75f14ae90..fbf5ca86a 100644 --- a/services/graphics-server/src/panic.rs +++ b/services/graphics-server/src/panic.rs @@ -34,7 +34,6 @@ const TOP_OFFSET: usize = 48; /// Width and height of the panic box in characters const WIDTH_CHARS: usize = 40; const HEIGHT_CHARS: usize = 24; -const TOTAL_CHARS: usize = WIDTH_CHARS * HEIGHT_CHARS; /// these are fixed by the monospace font const GLYPH_HEIGHT: usize = 15; const GLYPH_WIDTH: usize = 7; @@ -57,7 +56,6 @@ pub(crate) fn panic_handler_thread( .expect("Couldn't create panic server"); let mut display = unsafe { PanicDisplay::new(hwfb, control) }; - let mut panic_text = xous_ipc::String::::new(); loop { let msg = xous::receive_message(panic_server).unwrap(); @@ -67,7 +65,6 @@ pub(crate) fn panic_handler_thread( is_panic.store(true, Ordering::Relaxed); display.panic_rectangle(); display.append_string(" ~~Guru Meditation~~\n\n"); - display.update_dirty(); } let body = match msg.body.memory_message() { Some(body) => body, @@ -84,13 +81,7 @@ pub(crate) fn panic_handler_thread( &body.buf.as_slice()[..len] )}; display.append_string(s); - panic_text.append( - unsafe{ - core::str::from_utf8_unchecked( - &body.buf.as_slice()[..len] - ) - } - ).ok(); + display.update_dirty(); } } diff --git a/services/shellchat/src/cmds/test.rs b/services/shellchat/src/cmds/test.rs index 33acf70f7..2abad0a3c 100644 --- a/services/shellchat/src/cmds/test.rs +++ b/services/shellchat/src/cmds/test.rs @@ -106,6 +106,9 @@ impl<'a> ShellCmdApi<'a> for Test { if let Some(sub_cmd) = tokens.next() { match sub_cmd { + "panic" => { + assert!(1 == 0, "Panic test: 1 == 0 failure!"); + } "instant" => { write!(ret, "start elapsed_ms {}\n", env.ticktimer.elapsed_ms()).unwrap(); let now = Instant::now();