From a47e125c1fb964c5368684d889622380eda7810d Mon Sep 17 00:00:00 2001 From: Tom Pittenger Date: Thu, 11 May 2023 12:55:43 -0700 Subject: [PATCH] Tools: add ./waf --upload-force arg to allow uploader.py to do --force --- Tools/ardupilotwaf/ardupilotwaf.py | 5 +++++ Tools/ardupilotwaf/chibios.py | 2 ++ 2 files changed, 7 insertions(+) diff --git a/Tools/ardupilotwaf/ardupilotwaf.py b/Tools/ardupilotwaf/ardupilotwaf.py index 4b706603e4..c3363fcff8 100644 --- a/Tools/ardupilotwaf/ardupilotwaf.py +++ b/Tools/ardupilotwaf/ardupilotwaf.py @@ -565,6 +565,11 @@ arducopter and upload it to my board". 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. ''') + g.add_option('--upload-force', + action='store_true', + help='''Override board type check and continue loading. Same as using uploader.py --force. +''') + g = opt.ap_groups['check'] g.add_option('--check-verbose', diff --git a/Tools/ardupilotwaf/chibios.py b/Tools/ardupilotwaf/chibios.py index 739a8f2acc..d7bf2dff1f 100644 --- a/Tools/ardupilotwaf/chibios.py +++ b/Tools/ardupilotwaf/chibios.py @@ -69,6 +69,8 @@ class upload_fw(Task.Task): cmd = "{} '{}/uploader.py' '{}'".format(self.env.get_flat('PYTHON'), upload_tools, src.abspath()) if upload_port is not None: cmd += " '--port' '%s'" % upload_port + if self.generator.bld.options.upload_force: + cmd += " '--force'" return self.exec_command(cmd) def wsl2_prereq_checks(self):