diff options
| author | hathach <[email protected]> | 2024-10-15 17:55:24 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2024-10-15 17:55:24 +0700 |
| commit | 4012e150757b517620465d93a22b0787c6400c5d (patch) | |
| tree | 74987698f27e95d8bed1ce20f4b89b41dc4cb7b5 /tools | |
| parent | 10a3aa3cc8f58a783d2109f5a6c9a4012992f982 (diff) | |
move core init code to dwc2 common. update/correct build for esppressif
Diffstat (limited to 'tools')
| -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..b4a1dc096 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) + 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": |
