From 70aa5b792b493052fa72b247b2c07f89b1417031 Mon Sep 17 00:00:00 2001 From: bunnie Date: Mon, 1 Mar 2021 14:40:39 +0800 Subject: [PATCH] check in for inspection --- kernel/Cargo.toml | 4 ++-- services/gam/src/main.rs | 8 ++++++-- services/gam/src/status.rs | 2 +- services/keyboard/src/main.rs | 5 ++++- xtask/src/main.rs | 4 ++-- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/kernel/Cargo.toml b/kernel/Cargo.toml index 4ffce8b58..48c4a326b 100644 --- a/kernel/Cargo.toml +++ b/kernel/Cargo.toml @@ -21,8 +21,8 @@ riscv = "0.5.6" debug-print = [] print-panics = [] report-memory = ["stats_alloc"] -#default = ["print-panics", "debug-print"] -default = ["print-panics"] +default = ["print-panics", "debug-print"] +#default = ["print-panics"] [target.'cfg(any(windows, unix))'.dependencies] lazy_static = "1.4" diff --git a/services/gam/src/main.rs b/services/gam/src/main.rs index a818b46bc..725164800 100644 --- a/services/gam/src/main.rs +++ b/services/gam/src/main.rs @@ -141,10 +141,12 @@ fn xmain() -> ! { info!("GAM: entering main loop"); loop { let maybe_env = xous::try_receive_message(gam_sid).unwrap(); + info!("GAM: Maybe Message: {:?}", maybe_env); match maybe_env { Some(envelope) => { - // info!("GAM: Message: {:?}", envelope); + info!("GAM: Message: {:?}", envelope); if let Ok(opcode) = Opcode::try_from(&envelope.body) { + info!("GAM: Opcode: {:?}", opcode); match opcode { Opcode::ClearCanvas(gid) => { match canvases.get(&gid) { @@ -185,6 +187,7 @@ fn xmain() -> ! { match &*value { rkyv::Archived::::RenderTextView(rtv) => { let mut tv = rtv.unarchive(); + info!("GAM: rendertextview {:?}", tv); match tv.get_op() { TextOp::Nop => (), TextOp::Render | TextOp::ComputeBounds => { @@ -215,7 +218,7 @@ fn xmain() -> ! { }, }; - } + }, _ => panic!("GAM: invalid mutable borrow message"), }; } else if let xous::Message::Borrow(m) = &envelope.body { @@ -228,6 +231,7 @@ fn xmain() -> ! { match &*value { rkyv::Archived::::RenderObject(rtv) => { let obj: GamObject = rtv.unarchive(); + info!("GAM: renderobject {:?}", obj); if let Some(canvas) = canvases.get_mut(&obj.canvas) { // first, figure out if we should even be drawing to this canvas. if canvas.is_drawable() { diff --git a/services/gam/src/status.rs b/services/gam/src/status.rs index dcc0d06a2..ca6965e09 100644 --- a/services/gam/src/status.rs +++ b/services/gam/src/status.rs @@ -56,7 +56,7 @@ pub fn status_thread(canvas_gid: [u32; 4]) { Point::new(screensize.x, screensize.y), style_dark )).expect("GAM|status: Can't draw border line"); -loop { + loop { let maybe_env = xous::try_receive_message(status_sid).unwrap(); match maybe_env { Some(envelope) => { diff --git a/services/keyboard/src/main.rs b/services/keyboard/src/main.rs index 59f24a354..366ca657a 100644 --- a/services/keyboard/src/main.rs +++ b/services/keyboard/src/main.rs @@ -812,6 +812,7 @@ fn xmain() -> ! { let mut injected_keys: Queue = Queue::u8(); #[cfg(not(target_os = "none"))] let (mut key_enqueue, mut key_dequeue) = injected_keys.split(); + /* loop { let maybe_env = xous::try_receive_message(kbd_sid).unwrap(); match maybe_env { @@ -941,5 +942,7 @@ fn xmain() -> ! { xous::send_message(*conn, api::Opcode::KeyboardEvent(keys).into()).map(|_| ()).expect("KBD: Couldn't send event to listener"); } } - } + }*/ + // this shuts up the keyboard thread from polluting the kernel logs when panics happen elsewhere + loop {xous::receive_message(kbd_sid).unwrap(); xous::yield_slice();} } diff --git a/xtask/src/main.rs b/xtask/src/main.rs index ff6839bf9..4f8e380fa 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -37,8 +37,8 @@ fn main() { fn try_main() -> Result<(), DynError> { let hw_pkgs = [ - //"gam", - "shell", + "gam", + //"shell", "graphics-server", "ticktimer-server", "log-server",