VID and PID
This commit is contained in:
+5
-10
@@ -43,22 +43,17 @@ class RP2040UploaderApp:
|
||||
return entry
|
||||
|
||||
def find_rp2040_port(self):
|
||||
ports = serial.tools.list_ports.comports()
|
||||
if not ports:
|
||||
return None
|
||||
target_vid = 0x239A
|
||||
target_pid = 0x80F2
|
||||
|
||||
# Look for common Pico descriptors
|
||||
ports = serial.tools.list_ports.comports()
|
||||
for port in ports:
|
||||
desc = port.description.lower()
|
||||
if any(keyword in desc for keyword in ["pico", "rp2", "raspberry", "board"]):
|
||||
if port.vid == target_vid and port.pid == target_pid:
|
||||
return port.device
|
||||
|
||||
# Fall back to the only port found
|
||||
if len(ports) == 1:
|
||||
return ports[0].device
|
||||
|
||||
return None
|
||||
|
||||
|
||||
def load_config(self):
|
||||
if os.path.isfile(self.config_path):
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user