summaryrefslogtreecommitdiff
path: root/tools/build_board.py
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2022-01-17 12:36:39 +0700
committerGitHub <[email protected]>2022-01-17 12:36:39 +0700
commitefc29baead577185c577bf8e313f4c411f4eae9e (patch)
tree1a081093d4196ae478d2bf8e3e8136d81c2dc77e /tools/build_board.py
parent8d373b08879ac382c59dcbfb2d351d4af35e3d00 (diff)
parent976405dea3bc421cd3631b3af93380bdb122af66 (diff)
Merge branch 'master' into port-ft90x
Diffstat (limited to 'tools/build_board.py')
-rw-r--r--tools/build_board.py31
1 files changed, 3 insertions, 28 deletions
diff --git a/tools/build_board.py b/tools/build_board.py
index 9397c754f..b2a80c680 100644
--- a/tools/build_board.py
+++ b/tools/build_board.py
@@ -4,6 +4,8 @@ import sys
import subprocess
import time
+import build_utils
+
SUCCEEDED = "\033[32msucceeded\033[0m"
FAILED = "\033[31mfailed\033[0m"
SKIPPED = "\033[33mskipped\033[0m"
@@ -50,7 +52,7 @@ def build_board(example, board):
sram_size = "-"
# Check if board is skipped
- if skip_example(example, board):
+ if build_utils.skip_example(example, board):
success = SKIPPED
skip_count += 1
print(build_format.format(example, board, success, '-', flash_size, sram_size))
@@ -82,33 +84,6 @@ def build_size(example, board):
sram_size = int(size_list[1]) + int(size_list[2])
return (flash_size, sram_size)
-def skip_example(example, board):
- ex_dir = 'examples/' + example
- board_mk = 'hw/bsp/{}/board.mk'.format(board)
- with open(board_mk) as mk:
- mk_contents = mk.read()
-
- # Skip all OPT_MCU_NONE these are WIP port
- if '-DCFG_TUSB_MCU=OPT_MCU_NONE' in mk_contents:
- return 1
-
- # Skip if CFG_TUSB_MCU in board.mk to match skip file
- for skip_file in glob.iglob(ex_dir + '/.skip.MCU_*'):
- mcu_cflag = '-DCFG_TUSB_MCU=OPT_' + os.path.basename(skip_file).split('.')[2]
- if mcu_cflag in mk_contents:
- return 1
-
- # Build only list, if exists only these MCU are built
- only_list = list(glob.iglob(ex_dir + '/.only.MCU_*'))
- if len(only_list) > 0:
- for only_file in only_list:
- mcu_cflag = '-DCFG_TUSB_MCU=OPT_' + os.path.basename(only_file).split('.')[2]
- if mcu_cflag in mk_contents:
- return 0
- return 1
-
- return 0
-
print(build_separator)
print(build_format.format('Example', 'Board', '\033[39mResult\033[0m', 'Time', 'Flash', 'SRAM'))