eric6/MicroPython/MicroPythonDevices.py

changeset 8222
5994b80b8760
parent 8218
7c09585bd960
child 8259
2bbec88047dd
diff -r 0572a215bd2f -r 5994b80b8760 eric6/MicroPython/MicroPythonDevices.py
--- a/eric6/MicroPython/MicroPythonDevices.py	Sun Apr 11 16:53:48 2021 +0200
+++ b/eric6/MicroPython/MicroPythonDevices.py	Sun Apr 11 18:45:10 2021 +0200
@@ -210,16 +210,18 @@
             continue
         
         for board in SupportedBoards:
-            if ((vid, pid) in SupportedBoards[board]["ids"] or
-                    (vid, None) in SupportedBoards[board]["ids"]):
-                if board in ("bbc_microbit", "calliope"):
+            if (
+                (vid, pid) in SupportedBoards[board]["ids"] or
+                (vid, None) in SupportedBoards[board]["ids"]
+            ):
+                if (
+                    board in ("bbc_microbit", "calliope") and
+                    (port.description().strip() !=
+                     SupportedBoards[board]["port_description"])
+                ):
                     # both boards have the same VID and PID
                     # try to differentiate based on port description
-                    if (
-                        port.description().strip() !=
-                        SupportedBoards[board]["port_description"]
-                    ):
-                        continue
+                    continue
                 foundDevices.append((
                     board,
                     port.description(),
@@ -229,19 +231,18 @@
                     pid,
                 ))
                 supported = True
-        if not supported:
+        if not supported and (vid, pid) in manualDevices:
             # check the locally added ones next
-            if (vid, pid) in manualDevices:
-                board = manualDevices[(vid, pid)]["type"]
-                foundDevices.append((
-                    board,
-                    port.description(),
-                    SupportedBoards[board]["description"],
-                    port.portName(),
-                    vid,
-                    pid,
-                ))
-                supported = True
+            board = manualDevices[(vid, pid)]["type"]
+            foundDevices.append((
+                board,
+                port.description(),
+                SupportedBoards[board]["description"],
+                port.portName(),
+                vid,
+                pid,
+            ))
+            supported = True
         if not supported:
             if vid and pid:
                 if (vid, pid) not in IgnoredBoards:

eric ide

mercurial