From e2794d5f8459273bd55b07442ac662df78701590 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Wed, 31 May 2023 12:38:15 +0200 Subject: [PATCH] [builder] Fix running ltchiptool with no baudrate --- builder/utils/ltchiptool.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/builder/utils/ltchiptool.py b/builder/utils/ltchiptool.py index fc1238d..4ac01c1 100644 --- a/builder/utils/ltchiptool.py +++ b/builder/utils/ltchiptool.py @@ -59,14 +59,23 @@ def env_uf2ota(env: Environment, *args, **kwargs): def env_flash_write(env: Environment): + # UPLOAD_PROTOCOL = upload_protocol or board->upload.protocol + # UPLOAD_PORT = upload_port (PIO can choose this automatically I guess) + # UPLOAD_SPEED = upload_speed or board->upload.speed (**can be empty**) protocol = env.subst("${UPLOAD_PROTOCOL}") + speed = env.subst("${UPLOAD_SPEED}") if protocol == "uart": # upload via UART + if speed: + return [ + "-d", + "${UPLOAD_PORT}", + "-b", + "${UPLOAD_SPEED}", + ] return [ "-d", "${UPLOAD_PORT}", - "-b", - "${UPLOAD_SPEED}", ] else: # can't upload via ltchiptool