mirror of
https://github.com/hathach/tinyusb.git
synced 2025-04-16 14:42:58 +00:00
update size to fix macos ci
This commit is contained in:
parent
0a1a61bb6c
commit
956d1c9c4e
@ -61,7 +61,7 @@ ifdef USE_IAR
|
|||||||
AS = iasmarm
|
AS = iasmarm
|
||||||
LD = ilinkarm
|
LD = ilinkarm
|
||||||
OBJCOPY = ielftool
|
OBJCOPY = ielftool
|
||||||
SIZE = echo "size not available for IAR"
|
SIZE = size
|
||||||
|
|
||||||
else
|
else
|
||||||
CC = $(CROSS_COMPILE)gcc
|
CC = $(CROSS_COMPILE)gcc
|
||||||
|
@ -114,9 +114,15 @@ def build_example(example, board, make_option):
|
|||||||
|
|
||||||
|
|
||||||
def build_size(example, board):
|
def build_size(example, board):
|
||||||
elf_file = 'examples/{}/_build/{}/*.elf'.format(example, board)
|
size_cmd = 'make -j -C examples/{} BOARD={} size'.format(example, board)
|
||||||
size_output = subprocess.run('size {}'.format(elf_file), shell=True, stdout=subprocess.PIPE).stdout.decode("utf-8")
|
size_output = subprocess.run(size_cmd, shell=True, stdout=subprocess.PIPE).stdout.decode("utf-8").splitlines()
|
||||||
size_list = size_output.split('\n')[1].split('\t')
|
for i, l in enumerate(size_output):
|
||||||
|
text_title = 'text data bss dec'
|
||||||
|
if text_title in l:
|
||||||
|
size_list = size_output[i+1].split('\t')
|
||||||
|
break
|
||||||
|
|
||||||
flash_size = int(size_list[0])
|
flash_size = int(size_list[0])
|
||||||
sram_size = int(size_list[1]) + int(size_list[2])
|
sram_size = int(size_list[1]) + int(size_list[2])
|
||||||
return (flash_size, sram_size)
|
return (flash_size, sram_size)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user