diff options
| author | Ha Thach <[email protected]> | 2024-11-14 10:25:52 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-11-14 10:25:52 +0700 |
| commit | 0af07f1cffa025da8a2b153280e07760a90a96d8 (patch) | |
| tree | 193a894c1f8ca30011cf76b2aef629756ab14814 /tools/build_utils.py | |
| parent | b648a38ae84181757d4c8bdbd3f92001448ac805 (diff) | |
| parent | 6f11f99f989660384611d846fc6de7ccdf008b0e (diff) | |
Merge branch 'master' into warning
Diffstat (limited to 'tools/build_utils.py')
| -rwxr-xr-x | tools/build_utils.py | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/tools/build_utils.py b/tools/build_utils.py index 5462829e2..2998f940d 100755 --- a/tools/build_utils.py +++ b/tools/build_utils.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 import subprocess import pathlib -import time +import re build_format = '| {:29} | {:30} | {:18} | {:7} | {:6} | {:6} |' @@ -36,18 +36,21 @@ def skip_example(example, board): mk_contents = board_mk.read_text() mcu = "NONE" - for token in mk_contents.split(): - if "CFG_TUSB_MCU=OPT_MCU_" in token: - # Strip " because cmake files has them. - token = token.strip("\"") - _, opt_mcu = token.split("=") - mcu = opt_mcu[len("OPT_MCU_"):] - if "esp32s2" in token: - mcu = "ESP32S2" - if "esp32s3" in token: - mcu = "ESP32S3" - if mcu != "NONE": - break + if family == "espressif": + for line in mk_contents.splitlines(): + match = re.search(r'set\(IDF_TARGET\s+"([^"]+)"\)', line) + if match: + mcu = match.group(1).upper() + break + else: + for token in mk_contents.split(): + if "CFG_TUSB_MCU=OPT_MCU_" in token: + # Strip " because cmake files has them. + token = token.strip("\"") + _, opt_mcu = token.split("=") + mcu = opt_mcu[len("OPT_MCU_"):] + if mcu != "NONE": + break # Skip all OPT_MCU_NONE these are WIP port if mcu == "NONE": |
