summaryrefslogtreecommitdiff
path: root/tools/mpy-tool.py
diff options
context:
space:
mode:
authorYoctopuce <dev@yoctopuce.com>2024-06-26 10:10:32 +0200
committerDamien George <damien@micropython.org>2024-06-27 17:53:31 +1000
commitb4213c9c920afb8da5d3d123b26527e26dceb877 (patch)
treef25e5f46180fd41f4c492c00e4f71a213752f740 /tools/mpy-tool.py
parent706a4b44777280372ab5f77dd548f3764e82dbae (diff)
tools/mpy-tool.py: Implement freezing of long-long ints.
Allow inclusion of large integer constants in frozen files using long-long representation (mpy-cross option -mlongint-impl=longlong). Signed-off-by: Yoctopuce <dev@yoctopuce.com>
Diffstat (limited to 'tools/mpy-tool.py')
-rwxr-xr-xtools/mpy-tool.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/mpy-tool.py b/tools/mpy-tool.py
index 3b06572c3..5007bbbac 100755
--- a/tools/mpy-tool.py
+++ b/tools/mpy-tool.py
@@ -735,8 +735,8 @@ class CompiledModule:
elif config.MICROPY_LONGINT_IMPL == config.MICROPY_LONGINT_IMPL_NONE:
raise FreezeError(self, "target does not support long int")
elif config.MICROPY_LONGINT_IMPL == config.MICROPY_LONGINT_IMPL_LONGLONG:
- # TODO
- raise FreezeError(self, "freezing int to long-long is not implemented")
+ print("static const mp_obj_int_t %s = {{&mp_type_int}, %d};" % (obj_name, obj))
+ return "MP_ROM_PTR(&%s)" % obj_name
elif config.MICROPY_LONGINT_IMPL == config.MICROPY_LONGINT_IMPL_MPZ:
neg = 0
if obj < 0: