Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tools: add --upload-port option to waf #12404

Merged
merged 1 commit into from Oct 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions Tools/ardupilotwaf/ardupilotwaf.py
Expand Up @@ -507,6 +507,13 @@ def options(opt):
arducopter and upload it to my board".
''')

g.add_option('--upload-port',
action='store',
dest='upload_port',
default=None,
help='''Specify the port to be used with the --upload option. For example a port of /dev/ttyS10 indicates that serial port 10 shuld be used.
andyp1per marked this conversation as resolved.
Show resolved Hide resolved
''')

g = opt.ap_groups['check']

g.add_option('--check-verbose',
Expand Down
6 changes: 5 additions & 1 deletion Tools/ardupilotwaf/chibios.py
Expand Up @@ -53,8 +53,12 @@ class upload_fw(Task.Task):
always_run = True
def run(self):
upload_tools = self.env.get_flat('UPLOAD_TOOLS')
upload_port = self.generator.bld.options.upload_port
src = self.inputs[0]
return self.exec_command("{} '{}/uploader.py' '{}'".format(self.env.get_flat('PYTHON'), upload_tools, src))
cmd = "{} '{}/uploader.py' '{}'".format(self.env.get_flat('PYTHON'), upload_tools, src)
if upload_port is not None:
cmd += " '--port' '%s'" % upload_port
return self.exec_command(cmd)

def exec_command(self, cmd, **kw):
kw['stdout'] = sys.stdout
Expand Down