From b062b953488fa3d6d33875910b85f1e3cea2241f Mon Sep 17 00:00:00 2001 From: Martin Milata Date: Thu, 9 Sep 2021 16:35:02 +0200 Subject: [PATCH] chore(vendor): bump micropython to 1.15 Relevant micropython commits: ad4656b861f94277bed9647ca176e662ce5119e3 all: Rename BYTES_PER_WORD to MP_BYTES_PER_OBJ_WORD. 9fef1c0bde2f9642d383bd56aa112447384a84ba py: Rename remaining object types to be of the form mp_type_xxx. 5fdf351178df9a18df624ae0f5947d8a5a6bce40 py/gc: Don't include mpconfig.h and misc.h in gc.h. --- core/embed/extmod/modtrezorutils/modtrezorutils-meminfo.h | 6 +++--- core/embed/unix/main.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/embed/extmod/modtrezorutils/modtrezorutils-meminfo.h b/core/embed/extmod/modtrezorutils/modtrezorutils-meminfo.h index 359563c486..8bb6e3fff5 100644 --- a/core/embed/extmod/modtrezorutils/modtrezorutils-meminfo.h +++ b/core/embed/extmod/modtrezorutils/modtrezorutils-meminfo.h @@ -38,7 +38,7 @@ #include -#define WORDS_PER_BLOCK ((MICROPY_BYTES_PER_GC_BLOCK) / BYTES_PER_WORD) +#define WORDS_PER_BLOCK ((MICROPY_BYTES_PER_GC_BLOCK) / MP_BYTES_PER_OBJ_WORD) #define BYTES_PER_BLOCK (MICROPY_BYTES_PER_GC_BLOCK) // ATB = allocation table byte @@ -279,7 +279,7 @@ typedef struct _mp_obj_closure_t { } mp_obj_closure_t; extern const mp_obj_type_t mp_type_bound_meth; -extern const mp_obj_type_t closure_type; +extern const mp_obj_type_t mp_type_closure; extern const mp_obj_type_t mp_type_cell; extern const mp_obj_type_t mod_trezorio_WebUSB_type; extern const mp_obj_type_t mod_trezorio_USB_type; @@ -576,7 +576,7 @@ void dump_value_opt(FILE *out, mp_const_obj_t value, bool eval_short) { dump_bound_method(out, value); } - else if (mp_obj_is_type(value, &closure_type)) { + else if (mp_obj_is_type(value, &mp_type_closure)) { dump_closure(out, value); } diff --git a/core/embed/unix/main.c b/core/embed/unix/main.c index 98ce0fbb0e..cfe3647126 100644 --- a/core/embed/unix/main.c +++ b/core/embed/unix/main.c @@ -380,7 +380,7 @@ STATIC void pre_process_options(int argc, char **argv) { goto invalid_arg; } if (word_adjust) { - heap_size = heap_size * BYTES_PER_WORD / 4; + heap_size = heap_size * MP_BYTES_PER_OBJ_WORD / 4; } // If requested size too small, we'll crash anyway if (heap_size < 700) { @@ -492,7 +492,7 @@ MP_NOINLINE int main_(int argc, char **argv) { signal(SIGPIPE, SIG_IGN); #endif - mp_stack_set_limit(600000 * (BYTES_PER_WORD / 4)); + mp_stack_set_limit(600000 * (sizeof(void *) / 4)); pre_process_options(argc, argv);