diff --git a/services/modals/src/tests.rs b/services/modals/src/tests.rs index 18a50a407..d1aa840f1 100644 --- a/services/modals/src/tests.rs +++ b/services/modals/src/tests.rs @@ -136,8 +136,8 @@ pub fn spawn_test() { .expect("qrcode failed"); log::info!("qrcode test done"); - // 5. test image - #[cfg(feature="ditherpunk")] + // 5. test image - because it reads a local file, only makes sense on hosted mode + #[cfg(all(feature="ditherpunk", not(any(target_os = "none", target_os = "xous"))))] { log::info!("testing image"); let reader = match Reader::open("../services/modals/src/tests/bunny.png") { diff --git a/services/shellchat/src/cmds/test.rs b/services/shellchat/src/cmds/test.rs index bf9e22f84..ea03e76f9 100644 --- a/services/shellchat/src/cmds/test.rs +++ b/services/shellchat/src/cmds/test.rs @@ -608,7 +608,7 @@ impl<'a> ShellCmdApi<'a> for Test { write!(ret, "Ship mode request denied").unwrap(); } } - #[cfg(feature="ditherpunk")] + #[cfg(all(feature="ditherpunk", not(any(target_os = "none", target_os = "xous"))))] "modals" => { modals::tests::spawn_test(); } diff --git a/services/usb-device-xous/src/main.rs b/services/usb-device-xous/src/main.rs index b427a82c9..16d29e4be 100644 --- a/services/usb-device-xous/src/main.rs +++ b/services/usb-device-xous/src/main.rs @@ -25,9 +25,7 @@ use hosted::*; use num_traits::*; #[cfg(any(target_os = "none", target_os = "xous"))] use usb_device_xous::KeyboardLedsReport; -use usbd_human_interface_device::device::fido::{FidoInterface, FidoMsg}; use xous::{msg_scalar_unpack, msg_blocking_scalar_unpack}; -use core::ops::{DerefMut, Deref}; use core::num::NonZeroU8; use std::collections::BTreeMap; @@ -43,6 +41,10 @@ use usbd_human_interface_device::device::keyboard::NKROBootKeyboardInterface; use usbd_human_interface_device::prelude::*; #[cfg(any(target_os = "none", target_os = "xous"))] use num_enum::FromPrimitive as EnumFromPrimitive; +#[cfg(any(target_os = "none", target_os = "xous"))] +use core::ops::{DerefMut, Deref}; +#[cfg(any(target_os = "none", target_os = "xous"))] +use usbd_human_interface_device::device::fido::{FidoInterface, FidoMsg}; use embedded_time::Clock; use std::convert::TryInto; @@ -102,12 +104,20 @@ fn xmain() -> ! { None ).unwrap(); } + let mut fido_blocker: 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) => { + // this will prevent the FIDO stack from ever moving forward + fido_blocker = 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 @@ -124,6 +134,7 @@ fn xmain() -> ! { } } } + log::info!("Statement to consume the blocked message, preventing it from being dropped: {:?}", fido_blocker); } } @@ -202,6 +213,7 @@ fn xmain() -> ! { } let mut buffer = unsafe { Buffer::from_memory_message_mut(msg.body.memory_message_mut().unwrap()) }; let mut u2f_ipc = buffer.to_original::().unwrap(); + #[cfg(any(target_os = "none", target_os = "xous"))] if fido_listener_pid == msg.sender.pid() { let mut u2f_msg = FidoMsg::default(); assert_eq!(u2f_ipc.code, U2fCode::Tx, "Expected U2fCode::Tx in wrapper"); @@ -212,6 +224,8 @@ fn xmain() -> ! { } else { u2f_ipc.code = U2fCode::Denied; } + #[cfg(not(any(target_os = "none", target_os = "xous")))] + {u2f_ipc.code = U2fCode::Denied;} buffer.replace(u2f_ipc).unwrap(); } Some(Opcode::UsbIrqHandler) => { diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 5ffb06ee0..9fbd6a35e 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -412,7 +412,11 @@ fn main() -> Result<(), Box> { } generate_app_menus(&apps); // for hosted runs, compile in the pddb test routines by default...for now. - run(false, &pkgs, Some(&["--features", "pddbtest"]), false)? + run(false, &pkgs, + Some(&[ + "--features", "pddbtest", + "--features", "ditherpunk", + ]), false)? } Some("hosted-ci") => { let mut pkgs = hw_pkgs.to_vec();