[ci] Added customs RAM and ROM sections to the metric system

This commit is contained in:
M4x1m3
2020-07-18 15:40:03 +02:00
parent 57a37d7028
commit b87e9879bc
2 changed files with 10 additions and 2 deletions

View File

@@ -118,6 +118,7 @@ parser.add_argument('files', type=str, nargs='+', help='an ELF file')
parser.add_argument('--labels', type=str, nargs='+', help='label for ELF file')
parser.add_argument('--sections', type=str, nargs='+', help='Section (prefix) to list')
parser.add_argument('--escape', action='store_true', help='Escape the output')
parser.add_argument('--custom', type=str, action='append', nargs='+', help='Custom sections, made from the addition of other sections.')
args = parser.parse_args()
@@ -128,7 +129,14 @@ for i,filename in enumerate(args.files):
label = os.path.basename(filename)
if args.labels and i < len(args.labels):
label = args.labels[i]
table.append({'label': label, 'values': row_for_elf(filename, args.sections)})
values = row_for_elf(filename, args.sections)
for custom_section in args.custom:
if (len(custom_section) >= 2):
custom_section_size = 0
for i in range(len(custom_section) - 1):
custom_section_size += values[custom_section[i + 1]]
values[custom_section[0]] = custom_section_size
table.append({'label': label, 'values': values})
formatted_table = format_table(table)
if args.escape: