Commit fe16e785 authored by Damien George's avatar Damien George

tools/mpy-tool.py: List frozen modules in MICROPY_FROZEN_LIST_ITEM.

Signed-off-by: default avatarDamien George <damien@micropython.org>
parent 925bd67c
......@@ -916,6 +916,17 @@ def freeze_mpy(base_qstrs, raw_codes):
print(" &raw_code_%s," % rc.escaped_name)
print("};")
# If a port defines MICROPY_FROZEN_LIST_ITEM then list all modules wrapped in that macro.
print("#ifdef MICROPY_FROZEN_LIST_ITEM")
for rc in raw_codes:
module_name = rc.source_file.str
if module_name.endswith("/__init__.py"):
short_name = module_name[: -len("/__init__.py")]
else:
short_name = module_name[: -len(".py")]
print('MICROPY_FROZEN_LIST_ITEM("%s", "%s")' % (short_name, module_name))
print("#endif")
def merge_mpy(raw_codes, output_file):
assert len(raw_codes) <= 31 # so var-uints all fit in 1 byte
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment