merge_region_list now takes in just restrict_size instead of config.

merge_region_list was changed to do some extra checks regarding the
different regions. It only was checking the "restrict_size" parameter
and not the whole config option. So this reduces the argument down to
just this value. This makes it easier to serialize the data needed for
post build steps after being built in an exported project.
pull/10021/head
Brian Daniels 2019-03-08 15:18:19 -06:00
parent b419cfc3ed
commit 3b768de528
1 changed files with 4 additions and 3 deletions

View File

@ -106,8 +106,8 @@ def merge_region_list(
region_list,
destination,
notify,
config,
padding=b'\xFF'
padding=b'\xFF',
restrict_size=None
):
"""Merge the region_list into a single image
@ -115,6 +115,7 @@ def merge_region_list(
region_list - list of regions, which should contain filenames
destination - file name to write all regions to
padding - bytes to fill gaps with
restrict_size - check to ensure a region fits within the given size
"""
merged = IntelHex()
_, format = splitext(destination)
@ -145,7 +146,7 @@ def merge_region_list(
# Normally, we assume that part.maxddr() can be beyond
# end of rom. If the size is restricted with config, don't
# allow this.
if config.target.restrict_size is not None:
if restrict_size is not None:
part_size = (part.maxaddr() - part.minaddr()) + 1
if part_size > region.size:
raise ToolException(