From 3b768de5283073ac1e83f3d8301320165a6db910 Mon Sep 17 00:00:00 2001 From: Brian Daniels Date: Fri, 8 Mar 2019 15:18:19 -0600 Subject: [PATCH] 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. --- tools/regions.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/regions.py b/tools/regions.py index 3cc8eb8e58..d827145ad8 100644 --- a/tools/regions.py +++ b/tools/regions.py @@ -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(