@@ -568,13 +568,15 @@ STATIC const mp_rom_map_elem_t machine_encoder_locals_dict_table[] = {
568
568
};
569
569
STATIC MP_DEFINE_CONST_DICT (machine_encoder_locals_dict , machine_encoder_locals_dict_table );
570
570
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
+
578
580
579
581
// --- Counter class code ----------
580
582
@@ -693,12 +695,13 @@ STATIC const mp_rom_map_elem_t machine_counter_locals_dict_table[] = {
693
695
};
694
696
STATIC MP_DEFINE_CONST_DICT (machine_counter_locals_dict , machine_counter_locals_dict_table );
695
697
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
+ );
703
706
704
707
#endif // MICROPY_PY_MACHINE_QECNT
0 commit comments