mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-17 08:40:52 +00:00
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.
This commit is contained in:
parent
7f5a288090
commit
890c311102
1 changed files with 7 additions and 3 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue