From 890c311102d8500743b684b5340aedab607c56d9 Mon Sep 17 00:00:00 2001 From: bunnie Date: Sat, 13 Sep 2025 15:36:36 +0800 Subject: [PATCH] make the logger serial path more robust to failures the logger should not fail under any circumstances, so any errors in the USB stack should be ignored. --- services/xous-log/src/main.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/services/xous-log/src/main.rs b/services/xous-log/src/main.rs index edda3335c..1e1a8a60b 100644 --- a/services/xous-log/src/main.rs +++ b/services/xous-log/src/main.rs @@ -34,9 +34,13 @@ pub struct UsbString { #[cfg(feature = "usb")] fn usb_send_str(conn: xous::CID, s: &str) { let serializer = UsbString { s: String::from(s), sent: None }; - let buf = xous_ipc::Buffer::into_buf(serializer).expect("usb error"); - // failures to send are silent & ignored; also, this API doesn't block. - buf.send(conn, 8192 /* LogString */).expect("usb error"); + match xous_ipc::Buffer::into_buf(serializer) { + Ok(buf) => { + // failures to send are silent & ignored; also, this API doesn't block. + buf.send(conn, 8192 /* LogString */).ok(); + } + _ => {} // dont block on errors + } } fn reader_thread(arg: usize) {