Browse Source

usb: Use the PID assigned by pid.codes

Keir Fraser 4 years ago
parent
commit
124eb72d2c
2 changed files with 5 additions and 1 deletions
  1. 4 0
      scripts/greaseweazle/tools/util.py
  2. 1 1
      src/usb/config.c

+ 4 - 0
scripts/greaseweazle/tools/util.py

@@ -72,7 +72,11 @@ def find_port(old_port=None):
         score = 0
         if x.manufacturer == "Keir Fraser" and x.product == "Greaseweazle":
             score = 20
+        elif x.vid == 0x1209 and x.pid == 0x4d69:
+            # Our very own properly-assigned PID. Guaranteed to be us.
+            score = 20
         elif x.vid == 0x1209 and x.pid == 0x0001:
+            # Our old shared Test PID. It's not guaranteed to be us.
             score = 10
         if score > 0 and valid_ser_id(x.serial_number):
             if not old_port or not valid_ser_id(old_port.serial_number):

+ 1 - 1
src/usb/config.c

@@ -16,7 +16,7 @@ const uint8_t device_descriptor[] aligned(2) = {
     2, 0, 0,   /* Class, Subclass, Protocol: CDC */
     64,        /* Max Packet Size */
     0x09,0x12, /* VID = pid.codes Open Source projects */
-    0x01,0x00, /* PID = Test PID #1 */
+    0x69,0x4D, /* PID = Keir Fraser Greaseweazle */
     0,1,       /* Device Release 1.0 */
     1,2,3,     /* Manufacturer, Product, Serial */
     1          /* Number of configurations */