make upload on Linux much more reliable

Upload on Linux now only tries usb-3D_Robotics boards. This should
also make it handle more ports on MacOS
This commit is contained in:
Andrew Tridgell
2013-09-12 08:30:00 +10:00
committed by Lorenz Meier
parent 0308f399d9
commit 1f19a27e3c
2 changed files with 15 additions and 3 deletions

View File

@@ -400,7 +400,19 @@ print("Loaded firmware for %x,%x, waiting for the bootloader..." % (fw.property(
# Spin waiting for a device to show up
while True:
for port in args.port.split(","):
portlist = []
patterns = args.port.split(",")
# on unix-like platforms use glob to support wildcard ports. This allows
# the use of /dev/serial/by-id/usb-3D_Robotics on Linux, which prevents the upload from
# causing modem hangups etc
if "linux" in _platform or "darwin" in _platform:
import glob
for pattern in patterns:
portlist += glob.glob(pattern)
else:
portlist = patterns
for port in portlist:
#print("Trying %s" % port)