mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-17 08:40:52 +00:00
use serial numbers & interim pid/vid in USB stack
This commit is contained in:
parent
8402c601d2
commit
664ef0a6c4
2 changed files with 14 additions and 3 deletions
|
|
@ -85,9 +85,17 @@ impl<'a> Bao1xUsb<'a> {
|
|||
// to concurrently add that in - you have to kick out one of the interfaces above to add mass
|
||||
// storage!)
|
||||
|
||||
let device = UsbDeviceBuilder::new(&usb_alloc, UsbVidPid(0x1209, 0x3613))
|
||||
#[cfg(feature = "board-baosec")]
|
||||
let product = "Baosec";
|
||||
#[cfg(feature = "board-baosec")]
|
||||
let pid = 0x6198; // pending PR acceptance
|
||||
#[cfg(feature = "board-dabao")]
|
||||
let product = "Dabao";
|
||||
#[cfg(feature = "board-dabao")]
|
||||
let pid = 0x6197; // pending PR acceptance
|
||||
let device = UsbDeviceBuilder::new(&usb_alloc, UsbVidPid(0x1d50, pid))
|
||||
.manufacturer("Baochip")
|
||||
.product("Baosec")
|
||||
.product(product)
|
||||
.serial_number(&serial_number)
|
||||
// this is *required* by the corigine stack
|
||||
.max_packet_size_0(64)
|
||||
|
|
|
|||
|
|
@ -79,7 +79,10 @@ pub(crate) fn main_hw() -> ! {
|
|||
log::trace!("registered with NS -- {:?}", usbdev_sid);
|
||||
let tt = ticktimer::Ticktimer::new().unwrap();
|
||||
|
||||
let serial_number = format!("TODO!!"); // implement in bao1x-hal once we have a serial number API
|
||||
let serial_number = std::env::vars()
|
||||
.find(|(key, _value)| key == "PUBLIC_SERIAL")
|
||||
.map(|(_key, value)| value)
|
||||
.expect("Missing PUBLIC_SERIAL in environment");
|
||||
|
||||
let native_kbd = bao1x_api::keyboard::Keyboard::new(&xns).expect("couldn't connect to keyboard service");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue