From ec534609f665cb791b8fc1eae1a44e514c297659 Mon Sep 17 00:00:00 2001 From: Damien George Date: Sat, 13 May 2017 10:08:13 +1000 Subject: [PATCH] tools/mpy-tool.py: Use MP_ROM_xxx macros to support nanbox builds. --- tools/mpy-tool.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/mpy-tool.py b/tools/mpy-tool.py index aff4fd210..483a992db 100755 --- a/tools/mpy-tool.py +++ b/tools/mpy-tool.py @@ -332,25 +332,25 @@ def freeze(self, parent_name): raise FreezeError(self, 'freezing of object %r is not implemented' % (obj,)) # generate constant table - print('STATIC const mp_uint_t const_table_data_%s[%u] = {' + print('STATIC const mp_rom_obj_t const_table_data_%s[%u] = {' % (self.escaped_name, len(self.qstrs) + len(self.objs) + len(self.raw_codes))) for qst in self.qstrs: - print(' (mp_uint_t)MP_OBJ_NEW_QSTR(%s),' % global_qstrs[qst].qstr_id) + print(' MP_ROM_QSTR(%s),' % global_qstrs[qst].qstr_id) for i in range(len(self.objs)): if type(self.objs[i]) is float: print('#if MICROPY_OBJ_REPR == MICROPY_OBJ_REPR_A || MICROPY_OBJ_REPR == MICROPY_OBJ_REPR_B') - print(' (mp_uint_t)&const_obj_%s_%u,' % (self.escaped_name, i)) + print(' MP_ROM_PTR(&const_obj_%s_%u),' % (self.escaped_name, i)) print('#elif MICROPY_OBJ_REPR == MICROPY_OBJ_REPR_C') n = struct.unpack('