make hosted mode "happy" when running with HID calls

This commit is contained in:
bunnie 2022-06-06 19:00:19 +08:00
parent 66dc39c2a8
commit 6c94e61ab6

View file

@ -101,12 +101,20 @@ fn main() -> ! {
None
).unwrap();
}
let mut fido_listener: Option<xous::MessageEnvelope> = 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);
}
}