Update MicroPython from 1.12 to 1.17

This commit is contained in:
Yaya.Cout
2021-12-14 18:16:49 +01:00
parent 5cbce3c116
commit 38faecda29
162 changed files with 8326 additions and 3888 deletions

View File

@@ -78,18 +78,19 @@ STATIC void closure_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_
}
#endif
const mp_obj_type_t closure_type = {
const mp_obj_type_t mp_type_closure = {
{ &mp_type_type },
.flags = MP_TYPE_FLAG_BINDS_SELF,
.name = MP_QSTR_closure,
#if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_DETAILED
#if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_DETAILED
.print = closure_print,
#endif
#endif
.call = closure_call,
};
mp_obj_t mp_obj_new_closure(mp_obj_t fun, size_t n_closed_over, const mp_obj_t *closed) {
mp_obj_closure_t *o = m_new_obj_var(mp_obj_closure_t, mp_obj_t, n_closed_over);
o->base.type = &closure_type;
o->base.type = &mp_type_closure;
o->fun = fun;
o->n_closed = n_closed_over;
memcpy(o->closed, closed, n_closed_over * sizeof(mp_obj_t));