From 6c94e61ab6deaae8c6c3d1a259ab818c9ce8aab9 Mon Sep 17 00:00:00 2001 From: bunnie Date: Mon, 6 Jun 2022 19:00:19 +0800 Subject: [PATCH] make hosted mode "happy" when running with HID calls --- services/usb-device-xous/src/main.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/services/usb-device-xous/src/main.rs b/services/usb-device-xous/src/main.rs index 4fb4ad8a7..f8678312b 100644 --- a/services/usb-device-xous/src/main.rs +++ b/services/usb-device-xous/src/main.rs @@ -101,12 +101,20 @@ fn main() -> ! { None ).unwrap(); } + let mut fido_listener: Option = None; loop { let msg = xous::receive_message(usbdev_sid).unwrap(); match FromPrimitive::from_usize(msg.body.id()) { Some(Opcode::DebugUsbOp) => msg_blocking_scalar_unpack!(msg, _update_req, _new_state, _, _, { xous::return_scalar2(msg.sender, 0, 1).expect("couldn't return status"); }), + Some(Opcode::U2fRxDeferred) => { + // block any rx requests forever + fido_listener = Some(msg); + } + Some(Opcode::Quit) => { + break; + } _ => { log::warn!("SoC not compatible with HID, ignoring USB message: {:?}", msg); // make it so blocking scalars don't block @@ -123,6 +131,7 @@ fn main() -> ! { } } } + log::info!("consuming listener: {:?}", fido_listener); } }