all: Make all mp_obj_type_t defs use MP_DEFINE_CONST_OBJ_TYPE.

In preparation for upcoming rework of mp_obj_type_t layout.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit is contained in:
Jim Mussared
2021-07-14 14:38:38 +10:00
committed by Damien George
parent cdb880789f
commit 662b9761b3
227 changed files with 2543 additions and 2184 deletions

View File

@@ -162,11 +162,12 @@ STATIC const mp_rom_map_elem_t machine_led_locals_dict_table[] = {
};
STATIC MP_DEFINE_CONST_DICT(machine_led_locals_dict, machine_led_locals_dict_table);
const mp_obj_type_t machine_led_type = {
{ &mp_type_type },
.name = MP_QSTR_LED,
.print = machine_led_print,
.make_new = mp_led_make_new,
.call = machine_led_call,
.locals_dict = (mp_obj_t)&machine_led_locals_dict,
};
MP_DEFINE_CONST_OBJ_TYPE(
machine_led_type,
MP_QSTR_LED,
MP_TYPE_FLAG_NONE,
mp_led_make_new,
print, machine_led_print,
call, machine_led_call,
locals_dict, (mp_obj_t)&machine_led_locals_dict
);

View File

@@ -287,15 +287,16 @@ STATIC const mp_pin_p_t pin_pin_p = {
.ioctl = pin_ioctl,
};
const mp_obj_type_t machine_pin_type = {
{ &mp_type_type },
.name = MP_QSTR_Pin,
.print = machine_pin_print,
.make_new = mp_pin_make_new,
.call = machine_pin_call,
.protocol = &pin_pin_p,
.locals_dict = (mp_obj_t)&machine_pin_locals_dict,
};
MP_DEFINE_CONST_OBJ_TYPE(
machine_pin_type,
MP_QSTR_Pin,
MP_TYPE_FLAG_NONE,
mp_pin_make_new,
print, machine_pin_print,
call, machine_pin_call,
protocol, &pin_pin_p,
locals_dict, (mp_obj_t)&machine_pin_locals_dict
);
/*
STATIC mp_uint_t machine_pin_irq_trigger(mp_obj_t self_in, mp_uint_t new_trigger) {

View File

@@ -181,9 +181,10 @@ STATIC const mp_rom_map_elem_t samd_flash_locals_dict_table[] = {
};
STATIC MP_DEFINE_CONST_DICT(samd_flash_locals_dict, samd_flash_locals_dict_table);
const mp_obj_type_t samd_flash_type = {
{ &mp_type_type },
.name = MP_QSTR_Flash,
.make_new = samd_flash_make_new,
.locals_dict = (mp_obj_dict_t *)&samd_flash_locals_dict,
};
MP_DEFINE_CONST_OBJ_TYPE(
samd_flash_type,
MP_QSTR_Flash,
MP_TYPE_FLAG_NONE,
samd_flash_make_new,
locals_dict, (mp_obj_dict_t *)&samd_flash_locals_dict
);