From 1c68409a08456553977ab13027ad60d763f5ff45 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 23 Apr 2018 17:30:05 +0300 Subject: [PATCH] Improve support for Black Magic Probe in "uploader" role --- HISTORY.rst | 1 + docs | 2 +- platformio/builder/tools/pioupload.py | 10 ++++++---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index e912dd8d..4c9d1861 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -18,6 +18,7 @@ PlatformIO 3.0 option for `Project Configuration File "platformio.ini" `__ (information will be used by `PlatformIO Home `_) * Updated Unity tool to 2.4.3 +* Improved support for Black Magic Probe in "uploader" role * Fixed issue with useless project rebuilding for case insensitive file systems (Windows) * Fixed issue with ``build_unflags`` option when a macro contains value diff --git a/docs b/docs index 5222412b..a3f4e765 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 5222412b3f3856078e720658df897547b8fcc285 +Subproject commit a3f4e765e5d146df43b13719782d213cb2658359 diff --git a/platformio/builder/tools/pioupload.py b/platformio/builder/tools/pioupload.py index 63ba3b03..1ba523e4 100644 --- a/platformio/builder/tools/pioupload.py +++ b/platformio/builder/tools/pioupload.py @@ -130,10 +130,12 @@ def AutodetectUploadPort(*args, **kwargs): # pylint: disable=unused-argument if not _is_match_pattern(item['port']): continue port = item['port'] - if upload_protocol.startswith("blackmagic") \ - and "GDB" in item['description']: - return ("\\\\.\\%s" % port if "windows" in util.get_systype() - and port.startswith("COM") and len(port) > 4 else port) + if upload_protocol.startswith("blackmagic"): + if "windows" in util.get_systype() and \ + port.startswith("COM") and len(port) > 4: + port = "\\\\.\\%s" % port + if "GDB" in item['description']: + return port for hwid in board_hwids: hwid_str = ("%s:%s" % (hwid[0], hwid[1])).replace("0x", "") if hwid_str in item['hwid']: