tools/mpy-tool.py: Put frozen bignum digit data in ROM, not in RAM.
This commit is contained in:
parent
929d10acf7
commit
44fc92ea7c
|
@ -319,8 +319,8 @@ class RawCode:
|
||||||
ndigs = len(digs)
|
ndigs = len(digs)
|
||||||
digs = ','.join(('%#x' % d) for d in digs)
|
digs = ','.join(('%#x' % d) for d in digs)
|
||||||
print('STATIC const mp_obj_int_t %s = {{&mp_type_int}, '
|
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}}};'
|
'{.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, digs))
|
% (obj_name, neg, ndigs, ndigs, bits_per_dig, bits_per_dig, digs))
|
||||||
elif type(obj) is float:
|
elif type(obj) is float:
|
||||||
print('#if MICROPY_OBJ_REPR == MICROPY_OBJ_REPR_A || MICROPY_OBJ_REPR == MICROPY_OBJ_REPR_B')
|
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};'
|
print('STATIC const mp_obj_float_t %s = {{&mp_type_float}, %.16g};'
|
||||||
|
|
Loading…
Reference in New Issue