189 availablePorts = QSerialPortInfo.availablePorts() |
189 availablePorts = QSerialPortInfo.availablePorts() |
190 for port in availablePorts: |
190 for port in availablePorts: |
191 supported = False |
191 supported = False |
192 vid = port.vendorIdentifier() |
192 vid = port.vendorIdentifier() |
193 pid = port.productIdentifier() |
193 pid = port.productIdentifier() |
|
194 |
|
195 if vid == 0 and pid == 0: |
|
196 # no device detected at port |
|
197 continue |
|
198 |
194 for board in SupportedBoards: |
199 for board in SupportedBoards: |
195 if ((vid, pid) in SupportedBoards[board]["ids"] or |
200 if ((vid, pid) in SupportedBoards[board]["ids"] or |
196 (vid, None) in SupportedBoards[board]["ids"]): |
201 (vid, None) in SupportedBoards[board]["ids"]): |
197 if board in ("bbc_microbit", "calliope"): |
202 if board in ("bbc_microbit", "calliope"): |
198 # both boards have the same VID and PID |
203 # both boards have the same VID and PID |