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>
This commit is contained in:
Yoctopuce
2024-06-26 10:10:32 +02:00
committed by Damien George
parent 706a4b4477
commit b4213c9c92

View File

@@ -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: