Skip to content

Commit 3b768de

Browse files
committed
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.
1 parent b419cfc commit 3b768de

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tools/regions.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,16 @@ def merge_region_list(
106106
region_list,
107107
destination,
108108
notify,
109-
config,
110-
padding=b'\xFF'
109+
padding=b'\xFF',
110+
restrict_size=None
111111
):
112112
"""Merge the region_list into a single image
113113
114114
Positional Arguments:
115115
region_list - list of regions, which should contain filenames
116116
destination - file name to write all regions to
117117
padding - bytes to fill gaps with
118+
restrict_size - check to ensure a region fits within the given size
118119
"""
119120
merged = IntelHex()
120121
_, format = splitext(destination)
@@ -145,7 +146,7 @@ def merge_region_list(
145146
# Normally, we assume that part.maxddr() can be beyond
146147
# end of rom. If the size is restricted with config, don't
147148
# allow this.
148-
if config.target.restrict_size is not None:
149+
if restrict_size is not None:
149150
part_size = (part.maxaddr() - part.minaddr()) + 1
150151
if part_size > region.size:
151152
raise ToolException(

0 commit comments

Comments
 (0)