machine/usb: add support for ISERIAL descriptor

This commit is contained in:
sago35
2023-11-06 09:57:04 +09:00
committed by Ron Evans
parent ce25f00769
commit 2b215955ca
3 changed files with 25 additions and 4 deletions
+6 -2
View File
@@ -1,6 +1,6 @@
// to override the USB Manufacturer or Product names:
//
// tinygo flash -target circuitplay-express -ldflags="-X main.usbManufacturer='TinyGopher Labs' -X main.usbProduct='GopherKeyboard'" examples/hid-keyboard
// tinygo flash -target circuitplay-express -ldflags="-X main.usbManufacturer='TinyGopher Labs' -X main.usbProduct='GopherKeyboard' -X main.usbSerial='XXXXX'" examples/hid-keyboard
//
// you can also override the VID/PID. however, only set this if you know what you are doing,
// since changing it can make it difficult to reflash some devices.
@@ -15,7 +15,7 @@ import (
)
var usbVID, usbPID string
var usbManufacturer, usbProduct string
var usbManufacturer, usbProduct, usbSerial string
func main() {
button := machine.BUTTON
@@ -49,4 +49,8 @@ func init() {
if usbProduct != "" {
usb.Product = usbProduct
}
if usbSerial != "" {
usb.Serial = usbSerial
}
}