summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2025-10-09 21:42:32 +0700
committerGitHub <[email protected]>2025-10-09 21:42:32 +0700
commit0fab57b8c192615a019ac232229bf0e1d6b09c40 (patch)
treedae7741fdbecb101c4ae0c7d0f8d903881d78627 /tools
parent20c8e92f3a59bdc655a6d2b476ded21097068120 (diff)
parent16dd74912fd6627fcfa1dcd91a8e6f9150b0cced (diff)
Merge pull request #3279 from HiFiPhile/dwc2_ep0
dcd/dwc2: fix enumeration when EP0 size=8
Diffstat (limited to 'tools')
-rwxr-xr-xtools/gen_presets.py36
1 files changed, 34 insertions, 2 deletions
diff --git a/tools/gen_presets.py b/tools/gen_presets.py
index 94b8d16b0..94a9361db 100755
--- a/tools/gen_presets.py
+++ b/tools/gen_presets.py
@@ -5,13 +5,20 @@ from pathlib import Path
def main():
board_list = []
+ board_list_esp = []
- # Find all board.cmake files
+ # Find all board.cmake files, exclude espressif
for root, dirs, files in os.walk("hw/bsp"):
for file in files:
- if file == "board.cmake":
+ if file == "board.cmake" and "espressif" not in root:
board_list.append(os.path.basename(root))
+ # Find all espressif boards
+ for root, dirs, files in os.walk("hw/bsp/espressif"):
+ for file in files:
+ if file == "board.cmake":
+ board_list_esp.append(os.path.basename(root))
+
print('Generating presets for the following boards:')
print(board_list)
@@ -29,8 +36,17 @@ def main():
"cacheVariables": {
"CMAKE_DEFAULT_BUILD_TYPE": "RelWithDebInfo",
"BOARD": r"${presetName}"
+ }},
+ {"name": "default single config",
+ "hidden": True,
+ "description": r"Configure preset for the ${presetName} board",
+ "generator": "Ninja",
+ "binaryDir": r"${sourceDir}/build/${presetName}",
+ "cacheVariables": {
+ "BOARD": r"${presetName}"
}}]
+ # Add non-espressif boards
presets['configurePresets'].extend(
sorted(
[
@@ -43,6 +59,22 @@ def main():
)
)
+ # Add espressif boards with single config generator
+ presets['configurePresets'].extend(
+ sorted(
+ [
+ {
+ 'name': board,
+ 'inherits': 'default single config'
+ }
+ for board in board_list_esp
+ ], key=lambda x: x['name']
+ )
+ )
+
+ # Combine all boards
+ board_list.extend(board_list_esp)
+
# Build presets
# no inheritance since 'name' doesn't support macro expansion
presets['buildPresets'] = sorted(