diff --git a/Cargo.lock b/Cargo.lock index 8b058408e..612094160 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5254,7 +5254,6 @@ dependencies = [ "rkyv", "trng", "usb-device", - "usbd-human-interface-device", "usbd-serial", "usbd_mass_storage 0.1.0", "usbd_scsi 0.1.1", @@ -5267,6 +5266,7 @@ dependencies = [ "xous-api-ticktimer", "xous-ipc 0.9.54 (registry+https://github.com/rust-lang/crates.io-index)", "xous-semver", + "xous-usb-hid", ] [[package]] @@ -5282,7 +5282,6 @@ dependencies = [ "rand 0.8.5", "rand_chacha 0.3.1", "usb-device", - "usbd-human-interface-device", "utralib", "vcell", "xous 0.9.54 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5290,21 +5289,7 @@ dependencies = [ "xous-api-names", "xous-api-susres", "xous-api-ticktimer", -] - -[[package]] -name = "usbd-human-interface-device" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809d98d59a6fccbdcf27026101e9a753c5a98d66898061eee7dd8bfd4eff1d03" -dependencies = [ - "frunk", - "fugit", - "heapless 0.7.16", - "num_enum 0.6.1", - "option-block", - "packed_struct", - "usb-device", + "xous-usb-hid", ] [[package]] @@ -5479,7 +5464,6 @@ dependencies = [ "trng", "tts-frontend", "usb-device-xous", - "usbd-human-interface-device", "userprefs", "utralib", "xous 0.9.54 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5488,6 +5472,7 @@ dependencies = [ "xous-api-susres", "xous-api-ticktimer", "xous-ipc 0.9.54 (registry+https://github.com/rust-lang/crates.io-index)", + "xous-usb-hid", ] [[package]] @@ -6261,6 +6246,20 @@ dependencies = [ "xous-ipc 0.9.54 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "xous-usb-hid" +version = "0.4.3" +source = "git+https://github.com/betrusted-io/xous-usb-hid.git#eba35e886d08e504cf10026221aec0fbfc63e201" +dependencies = [ + "frunk", + "fugit", + "heapless 0.7.16", + "num_enum 0.6.1", + "option-block", + "packed_struct", + "usb-device", +] + [[package]] name = "xtask" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 29d0b50ee..a11afd5c7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -151,8 +151,6 @@ git="https://github.com/betrusted-io/usb-device.git" branch="main" # local dev shortcuts #path = "../usb-device" -#[patch.crates-io.usbd-human-interface-device] -#path = "../usbd-human-interface-device" [patch.crates-io.getrandom] path = "imports/getrandom" diff --git a/RELEASE-v0.9.md b/RELEASE-v0.9.md index 34677ae32..2d99d02a8 100644 --- a/RELEASE-v0.9.md +++ b/RELEASE-v0.9.md @@ -418,6 +418,7 @@ perform the Xous firmware upgrade. This requires running manual update commands, - sigchat skeleton added thanks to @nhoj - usbd-human-interface-device bumped to latest in preparation for a fork - Fix #446 - add support for numeric-only passwords in `vault` +- Fork usbd-human-interface-device to xous-usb-hid ## Roadmap - Lots of testing and bug fixes diff --git a/apps/vault/Cargo.toml b/apps/vault/Cargo.toml index 78f94f3d5..cde8d3d3d 100644 --- a/apps/vault/Cargo.toml +++ b/apps/vault/Cargo.toml @@ -17,7 +17,7 @@ graphics-server = {path = "../../services/graphics-server" } locales = {path = "../../locales"} tts-frontend = {path="../../services/tts"} usb-device-xous = {path="../../services/usb-device-xous"} -usbd-human-interface-device = "0.4.3" +xous-usb-hid = {git = "https://github.com/betrusted-io/xous-usb-hid.git"} pddb = {path = "../../services/pddb" } modals = {path = "../../services/modals" } trng = {path="../../services/trng"} diff --git a/apps/vault/src/env/xous/mod.rs b/apps/vault/src/env/xous/mod.rs index 7bccf5a04..3a67ef37f 100644 --- a/apps/vault/src/env/xous/mod.rs +++ b/apps/vault/src/env/xous/mod.rs @@ -16,7 +16,7 @@ use ctap_crypto::rng256::XousRng256; use xous::try_send_message; use xous_names::XousNames; use crate::env::xous::storage::XousUpgradeStorage; -use usbd_human_interface_device::device::fido::*; +use xous_usb_hid::device::fido::*; use modals::Modals; use locales::t; use std::io::{Read, Write}; diff --git a/apps/vault/src/main.rs b/apps/vault/src/main.rs index 4bfa75c07..df52cd2a5 100644 --- a/apps/vault/src/main.rs +++ b/apps/vault/src/main.rs @@ -29,7 +29,7 @@ use crate::vendor_commands::VendorSession; use ux::framework::{VaultUx, DEFAULT_FONT, FONT_LIST, name_to_style}; use xous_ipc::Buffer; use xous::{send_message, Message, msg_blocking_scalar_unpack, msg_scalar_unpack}; -use usbd_human_interface_device::device::fido::*; +use xous_usb_hid::device::fido::*; use num_traits::*; use std::thread; diff --git a/services/usb-device-xous/Cargo.toml b/services/usb-device-xous/Cargo.toml index d58923574..c52b4f268 100644 --- a/services/usb-device-xous/Cargo.toml +++ b/services/usb-device-xous/Cargo.toml @@ -26,10 +26,10 @@ xous-semver = "0.1.2" utralib = { version = "0.1.23", optional = true, default-features = false } trng = {path="../trng"} -usbd-human-interface-device = "0.4.3" +xous-usb-hid = {git = "https://github.com/betrusted-io/xous-usb-hid.git"} embedded-time = "0.12.1" # required by the keyboard interface -packed_struct = { version = "0.10", default-features = false } # used by the usbd-human-interface-device crate -num_enum = { version = "0.5", default-features = false } # used by the usbd-human-interface-device crate +packed_struct = { version = "0.10", default-features = false } # used by the xous-usb-hid crate +num_enum = { version = "0.5", default-features = false } # used by the xous-usb-hid crate # Mass storage support usbd_scsi = { path = "../../libs/mass-storage/usbd_scsi", optional = true } diff --git a/services/usb-device-xous/src/lib.rs b/services/usb-device-xous/src/lib.rs index 7e19ffc85..b9e57f9eb 100644 --- a/services/usb-device-xous/src/lib.rs +++ b/services/usb-device-xous/src/lib.rs @@ -6,11 +6,11 @@ use trng::api::TrngTestMode; use xous::{CID, send_message, Message}; use num_traits::*; pub use usb_device::device::UsbDeviceState; -pub use usbd_human_interface_device::device::keyboard::KeyboardLedsReport; -pub use usbd_human_interface_device::page::Keyboard as UsbKeyCode; +pub use xous_usb_hid::device::keyboard::KeyboardLedsReport; +pub use xous_usb_hid::page::Keyboard as UsbKeyCode; use packed_struct::PackedStruct; use xous_ipc::Buffer; -pub use usbd_human_interface_device::device::fido::RawFidoReport; +pub use xous_usb_hid::device::fido::RawFidoReport; #[derive(Debug)] pub struct UsbHid { diff --git a/services/usb-device-xous/src/main_hosted.rs b/services/usb-device-xous/src/main_hosted.rs index dcd766e56..96f230a2f 100644 --- a/services/usb-device-xous/src/main_hosted.rs +++ b/services/usb-device-xous/src/main_hosted.rs @@ -1,7 +1,7 @@ use crate::*; use num_traits::*; -use usbd_human_interface_device::device::fido::RawFidoReport; +use xous_usb_hid::device::fido::RawFidoReport; use xous::{msg_scalar_unpack, msg_blocking_scalar_unpack}; use xous_semver::SemVer; use core::num::NonZeroU8; diff --git a/services/usb-device-xous/src/main_hw.rs b/services/usb-device-xous/src/main_hw.rs index d9e398e4f..275942a81 100644 --- a/services/usb-device-xous/src/main_hw.rs +++ b/services/usb-device-xous/src/main_hw.rs @@ -3,10 +3,10 @@ use crate::*; use num_traits::*; use usb_device_xous::KeyboardLedsReport; use usb_device_xous::UsbDeviceType; -use usbd_human_interface_device::device::fido::RawFidoReport; -use usbd_human_interface_device::device::fido::RawFidoConfig; -use usbd_human_interface_device::device::fido::RawFido; -use usbd_human_interface_device::device::DeviceClass; +use xous_usb_hid::device::fido::RawFidoReport; +use xous_usb_hid::device::fido::RawFidoConfig; +use xous_usb_hid::device::fido::RawFido; +use xous_usb_hid::device::DeviceClass; use xous::{msg_scalar_unpack, msg_blocking_scalar_unpack}; #[cfg(not(feature="minimal"))] use xous_semver::SemVer; @@ -17,9 +17,9 @@ use utralib::generated::*; use usb_device::prelude::*; use usb_device::class_prelude::*; -use usbd_human_interface_device::page::Keyboard; -use usbd_human_interface_device::device::keyboard::{NKROBootKeyboard, NKROBootKeyboardConfig}; -use usbd_human_interface_device::prelude::*; +use xous_usb_hid::page::Keyboard; +use xous_usb_hid::device::keyboard::{NKROBootKeyboard, NKROBootKeyboardConfig}; +use xous_usb_hid::prelude::*; use std::convert::TryInto; #[cfg(not(feature="minimal"))] diff --git a/services/usb-device-xous/src/mappings.rs b/services/usb-device-xous/src/mappings.rs index c6706ac26..c68b9a18b 100644 --- a/services/usb-device-xous/src/mappings.rs +++ b/services/usb-device-xous/src/mappings.rs @@ -1,5 +1,5 @@ #![allow(dead_code)] -pub use usbd_human_interface_device::page::Keyboard as UsbKeyCode; +pub use xous_usb_hid::page::Keyboard as UsbKeyCode; #[cfg(any(feature="precursor", feature="renode"))] pub fn char_to_hid_code_us101(key: char) -> Vec { diff --git a/services/usb-test/Cargo.toml b/services/usb-test/Cargo.toml index 50af7ba91..3e6ce06df 100644 --- a/services/usb-test/Cargo.toml +++ b/services/usb-test/Cargo.toml @@ -20,7 +20,7 @@ bitfield = "0.13.2" vcell = "0.1.3" utralib = { version = "0.1.23", optional = true, default-features = false } -usbd-human-interface-device = "0.4.3" +xous-usb-hid = {git = "https://github.com/betrusted-io/xous-usb-hid.git"} embedded-time = "0.12.1" # required by the keyboard interface [dependencies.usb-device] diff --git a/services/usb-test/src/main.rs b/services/usb-test/src/main.rs index d9e58df13..9a218d64c 100644 --- a/services/usb-test/src/main.rs +++ b/services/usb-test/src/main.rs @@ -27,9 +27,9 @@ use std::collections::BTreeMap; use usb_device::prelude::*; use usb_device::class_prelude::*; -use usbd_human_interface_device::page::Keyboard; -use usbd_human_interface_device::device::keyboard::NKROBootKeyboard; -use usbd_human_interface_device::prelude::*; +use xous_usb_hid::page::Keyboard; +use xous_usb_hid::device::keyboard::NKROBootKeyboard; +use xous_usb_hid::prelude::*; use embedded_time::Clock; use std::convert::TryInto; @@ -100,7 +100,7 @@ fn main() -> ! { ) .build(&usb_alloc); let mut usb_dev = UsbDeviceBuilder::new(&usb_alloc, UsbVidPid(0x1209, 0x3613)) - .manufacturer("usbd-human-interface-device") + .manufacturer("xous-usb-hid") .product("NKRO Keyboard") .serial_number("PRECURSOR") .build();