tools/mpy-tool.py: Put frozen bignum digit data in ROM, not in RAM.

This commit is contained in:
Damien George 2018-07-09 13:43:34 +10:00
parent 929d10acf7
commit 44fc92ea7c

View File

@ -319,8 +319,8 @@ class RawCode:
ndigs = len(digs)
digs = ','.join(('%#x' % d) for d in digs)
print('STATIC const mp_obj_int_t %s = {{&mp_type_int}, '
'{.neg=%u, .fixed_dig=1, .alloc=%u, .len=%u, .dig=(uint%u_t[]){%s}}};'
% (obj_name, neg, ndigs, ndigs, bits_per_dig, digs))
'{.neg=%u, .fixed_dig=1, .alloc=%u, .len=%u, .dig=(uint%u_t*)(const uint%u_t[]){%s}}};'
% (obj_name, neg, ndigs, ndigs, bits_per_dig, bits_per_dig, digs))
elif type(obj) is float:
print('#if MICROPY_OBJ_REPR == MICROPY_OBJ_REPR_A || MICROPY_OBJ_REPR == MICROPY_OBJ_REPR_B')
print('STATIC const mp_obj_float_t %s = {{&mp_type_float}, %.16g};'