From a7ce3e62047da1673d1151cd5e5dd7d0a3635b6a Mon Sep 17 00:00:00 2001 From: bunnie Date: Mon, 27 Jun 2022 02:18:55 +0800 Subject: [PATCH] make keyboard tick() blocks non-fatal at the moment if for some reason the USB stack can't send a tick there's a panic. it's not actually a life-ending event if that happens. --- services/usb-device-xous/src/main.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/services/usb-device-xous/src/main.rs b/services/usb-device-xous/src/main.rs index b234b8398..31f335d7e 100644 --- a/services/usb-device-xous/src/main.rs +++ b/services/usb-device-xous/src/main.rs @@ -180,7 +180,7 @@ fn main() -> ! { { let keyboard = composite.interface::, _>(); keyboard.write_report(&Vec::::new()).ok(); - keyboard.tick().unwrap(); + keyboard.tick().ok(); } #[cfg(any(target_os = "none", target_os = "xous"))] @@ -414,11 +414,11 @@ fn main() -> ! { { let keyboard = composite.interface::, _>(); keyboard.write_report(&codes).ok(); - keyboard.tick().unwrap(); + keyboard.tick().ok(); tt.sleep_ms(30).ok(); if auto_up { keyboard.write_report(&[]).ok(); // this is the key-up - keyboard.tick().unwrap(); + keyboard.tick().ok(); tt.sleep_ms(30).ok(); } } @@ -450,10 +450,10 @@ fn main() -> ! { { let keyboard = composite.interface::, _>(); keyboard.write_report(&codes).ok(); - keyboard.tick().unwrap(); + keyboard.tick().ok(); tt.sleep_ms(30).ok(); keyboard.write_report(&[]).ok(); // this is the key-up - keyboard.tick().unwrap(); + keyboard.tick().ok(); tt.sleep_ms(30).ok(); } sent += 1;