mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
fix product description & serial number in baremetal
This commit is contained in:
parent
5bf4a6416a
commit
4a4b5f182d
2 changed files with 8 additions and 4 deletions
|
|
@ -60,10 +60,13 @@ pub fn get_descriptor_request(this: &mut CorigineUsb, value: u16, _index: usize,
|
||||||
ep0_buf[..4].copy_from_slice(&[4, USB_DT_STRING, 9, 4]);
|
ep0_buf[..4].copy_from_slice(&[4, USB_DT_STRING, 9, 4]);
|
||||||
4
|
4
|
||||||
} else {
|
} else {
|
||||||
|
let owc = bao1x_hal::acram::OneWayCounter::new();
|
||||||
|
let slot_mgr = bao1x_hal::acram::SlotManager::new();
|
||||||
|
let sn = bao1x_hal::usb::derive_usb_serial_number(&owc, &slot_mgr);
|
||||||
let s = match id {
|
let s = match id {
|
||||||
1 => MANUFACTURER,
|
1 => MANUFACTURER,
|
||||||
2 => PRODUCT,
|
2 => PRODUCT,
|
||||||
_ => SERIAL,
|
_ => &sn,
|
||||||
};
|
};
|
||||||
let slen = 2 + s.len() * 2;
|
let slen = 2 + s.len() * 2;
|
||||||
ep0_buf[0] = slen as u8;
|
ep0_buf[0] = slen as u8;
|
||||||
|
|
|
||||||
|
|
@ -132,9 +132,10 @@ struct DeviceDescriptor {
|
||||||
const VENDOR_ID: u16 = 0x1209;
|
const VENDOR_ID: u16 = 0x1209;
|
||||||
const PRODUCT_ID: u16 = 0x3613; // this needs to change! this is the Precursor product ID.
|
const PRODUCT_ID: u16 = 0x3613; // this needs to change! this is the Precursor product ID.
|
||||||
const MANUFACTURER: &'static str = "Baochip";
|
const MANUFACTURER: &'static str = "Baochip";
|
||||||
const PRODUCT: &'static str = "Dabao";
|
#[cfg(feature = "board-baosec")]
|
||||||
// no seriously, do this
|
const PRODUCT: &'static str = "Baosec-Baremetal";
|
||||||
const SERIAL: &'static str = "TODO";
|
#[cfg(not(feature = "board-baosec"))]
|
||||||
|
const PRODUCT: &'static str = "Dabao-Baremetal";
|
||||||
|
|
||||||
impl DeviceDescriptor {
|
impl DeviceDescriptor {
|
||||||
pub fn default_usb_acm() -> Self {
|
pub fn default_usb_acm() -> Self {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue