tools: Support external Esptool wrappers

Implements https://github.com/jimparis/esptool-ftdi/issues/3

Closes https://github.com/espressif/esp-idf/pull/6879
This commit is contained in:
Martin Babutzka
2021-04-15 16:19:25 +02:00
committed by Roland Dobai
parent 76fbb689fd
commit 6faf4941cc
2 changed files with 6 additions and 2 deletions

View File

@@ -37,9 +37,13 @@ def action_extensions(base_actions, project_path):
def _get_esptool_args(args):
esptool_path = os.path.join(os.environ['IDF_PATH'], 'components/esptool_py/esptool/esptool.py')
esptool_wrapper_path = os.environ.get('ESPTOOL_WRAPPER', '')
if args.port is None:
args.port = _get_default_serial_port(args)
result = [PYTHON, esptool_path]
result = [PYTHON]
if os.path.exists(esptool_wrapper_path):
result += [esptool_wrapper_path]
result += [esptool_path]
result += ['-p', args.port]
result += ['-b', str(args.baud)]