|
|
|
@ -64,9 +64,12 @@ import base64
@@ -64,9 +64,12 @@ import base64
|
|
|
|
|
import time |
|
|
|
|
import array |
|
|
|
|
import os |
|
|
|
|
import platform |
|
|
|
|
|
|
|
|
|
from sys import platform as _platform |
|
|
|
|
|
|
|
|
|
is_WSL = bool("Microsoft" in platform.uname()[2]) |
|
|
|
|
|
|
|
|
|
# default list of port names to look for autopilots |
|
|
|
|
default_ports = [ '/dev/serial/by-id/usb-Ardu*', |
|
|
|
|
'/dev/serial/by-id/usb-3D*', |
|
|
|
@ -78,7 +81,7 @@ default_ports = [ '/dev/serial/by-id/usb-Ardu*',
@@ -78,7 +81,7 @@ default_ports = [ '/dev/serial/by-id/usb-Ardu*',
|
|
|
|
|
'/dev/serial/by-id/usb-Holybro*', |
|
|
|
|
'/dev/tty.usbmodem*'] |
|
|
|
|
|
|
|
|
|
if "cygwin" in _platform: |
|
|
|
|
if "cygwin" in _platform or is_WSL: |
|
|
|
|
default_ports += [ '/dev/ttyS*' ] |
|
|
|
|
|
|
|
|
|
# Detect python version |
|
|
|
@ -771,9 +774,10 @@ def main():
@@ -771,9 +774,10 @@ def main():
|
|
|
|
|
args.source_component) |
|
|
|
|
|
|
|
|
|
except Exception as e: |
|
|
|
|
print("Exception creating uploader: %s" % str(e)) |
|
|
|
|
# open failed, rate-limit our attempts |
|
|
|
|
time.sleep(0.05) |
|
|
|
|
if not is_WSL: |
|
|
|
|
# open failed, WSL must cycle through all ttyS* ports quickly but rate limit everything else |
|
|
|
|
print("Exception creating uploader: %s" % str(e)) |
|
|
|
|
time.sleep(0.05) |
|
|
|
|
|
|
|
|
|
# and loop to the next port |
|
|
|
|
continue |
|
|
|
|