Skip to content

Commit 1bc7211

Browse files
committed
mimxrt: Adapt for PR8813 - Optimise mp_obj_type_t storage.
1 parent 6bc2e1f commit 1bc7211

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

ports/mimxrt/machine_encoder.c

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -568,13 +568,15 @@ STATIC const mp_rom_map_elem_t machine_encoder_locals_dict_table[] = {
568568
};
569569
STATIC MP_DEFINE_CONST_DICT(machine_encoder_locals_dict, machine_encoder_locals_dict_table);
570570

571-
const mp_obj_type_t machine_encoder_type = {
572-
{ &mp_type_type },
573-
.name = MP_QSTR_Encoder,
574-
.print = mp_machine_encoder_print,
575-
.make_new = mp_machine_encoder_make_new,
576-
.locals_dict = (mp_obj_dict_t *)&machine_encoder_locals_dict,
577-
};
571+
MP_DEFINE_CONST_OBJ_TYPE(
572+
machine_encoder_type,
573+
MP_QSTR_Encoder,
574+
MP_TYPE_FLAG_NONE,
575+
make_new, mp_machine_encoder_make_new,
576+
print, mp_machine_encoder_print,
577+
locals_dict, &machine_encoder_locals_dict
578+
);
579+
578580

579581
// --- Counter class code ----------
580582

@@ -693,12 +695,13 @@ STATIC const mp_rom_map_elem_t machine_counter_locals_dict_table[] = {
693695
};
694696
STATIC MP_DEFINE_CONST_DICT(machine_counter_locals_dict, machine_counter_locals_dict_table);
695697

696-
const mp_obj_type_t machine_counter_type = {
697-
{ &mp_type_type },
698-
.name = MP_QSTR_Counter,
699-
.print = mp_machine_encoder_print,
700-
.make_new = mp_machine_counter_make_new,
701-
.locals_dict = (mp_obj_dict_t *)&machine_counter_locals_dict,
702-
};
698+
MP_DEFINE_CONST_OBJ_TYPE(
699+
machine_counter_type,
700+
MP_QSTR_Counter,
701+
MP_TYPE_FLAG_NONE,
702+
make_new, mp_machine_counter_make_new,
703+
print, mp_machine_encoder_print,
704+
locals_dict, &machine_counter_locals_dict
705+
);
703706

704707
#endif // MICROPY_PY_MACHINE_QECNT

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy