From f31afa5125f48e3eaea3f9a85083d8703be8b051 Mon Sep 17 00:00:00 2001 From: bunnie Date: Sun, 11 Dec 2022 16:41:06 +0800 Subject: [PATCH] remove unused opcode in shellchat; improve debug output --- services/shellchat/src/main.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/services/shellchat/src/main.rs b/services/shellchat/src/main.rs index 6fb80cdbb..a5de5a746 100644 --- a/services/shellchat/src/main.rs +++ b/services/shellchat/src/main.rs @@ -372,8 +372,6 @@ enum ShellOpcode { Line = 0, // make sure we occupy opcodes with discriminants < 1000, as the rest are used for callbacks /// redraw our UI Redraw, - /// Used by the automounter to clear the "please wait..." message - ForceRedraw, /// change focus ChangeFocus, /// exit the application @@ -438,8 +436,9 @@ fn wrapped_main() -> ! { } loop { let msg = xous::receive_message(shch_sid).unwrap(); - log::debug!("got message {:?}", msg); - match FromPrimitive::from_usize(msg.body.id()) { + let shell_op: Option:: = FromPrimitive::from_usize(msg.body.id()); + log::debug!("Shellchat got message {:?}", msg); + match shell_op { Some(ShellOpcode::Line) => { let buffer = unsafe { Buffer::from_memory_message(msg.body.memory_message().unwrap()) }; let s = buffer.as_flat::, _>().unwrap(); @@ -459,11 +458,6 @@ fn wrapped_main() -> ! { repl.redraw(pddb_init_done.load(Ordering::SeqCst)).expect("REPL couldn't redraw"); } } - // Force a redraw without the "please wait" note. - Some(ShellOpcode::ForceRedraw) => { - repl.redraw(true).expect("REPL couldn't redraw"); - xous::return_scalar(msg.sender, 0).ok(); - } Some(ShellOpcode::ChangeFocus) => xous::msg_scalar_unpack!(msg, new_state_code, _, _, _, { let new_state = gam::FocusState::convert_focus_change(new_state_code); match new_state {