py/obj: Convert make_new into a mp_obj_type_t slot.
Instead of being an explicit field, it's now a slot like all the other methods. This is a marginal code size improvement because most types have a make_new (100/138 on PYBV11), however it improves consistency in how types are declared, removing the special case for make_new. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit is contained in:
parent
6da41b5900
commit
94beeabd2e
@ -73,7 +73,7 @@ int nina_bsp_init(void) {
|
||||
MP_OBJ_NEW_SMALL_INT(MICROPY_HW_WIFI_SPI_BAUDRATE),
|
||||
};
|
||||
|
||||
MP_STATE_PORT(mp_wifi_spi) = machine_spi_type.make_new((mp_obj_t)&machine_spi_type, 2, 0, args);
|
||||
MP_STATE_PORT(mp_wifi_spi) = MP_OBJ_TYPE_GET_SLOT(&machine_spi_type, make_new)((mp_obj_t)&machine_spi_type, 2, 0, args);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -20,8 +20,8 @@ mp_obj_t mpy_init(mp_obj_fun_bc_t *self, size_t n_args, size_t n_kw, mp_obj_t *a
|
||||
|
||||
mp_type_framebuf.base.type = (void*)&mp_type_type;
|
||||
mp_type_framebuf.name = MP_QSTR_FrameBuffer;
|
||||
mp_type_framebuf.make_new = framebuf_make_new;
|
||||
MP_OBJ_TYPE_SET_SLOT(&mp_type_framebuf, buffer, framebuf_get_buffer, 0);
|
||||
MP_OBJ_TYPE_SET_SLOT(&mp_type_framebuf, make_new, framebuf_make_new, 0);
|
||||
MP_OBJ_TYPE_SET_SLOT(&mp_type_framebuf, buffer, framebuf_get_buffer, 1);
|
||||
framebuf_locals_dict_table[0] = (mp_map_elem_t){ MP_OBJ_NEW_QSTR(MP_QSTR_fill), MP_OBJ_FROM_PTR(&framebuf_fill_obj) };
|
||||
framebuf_locals_dict_table[1] = (mp_map_elem_t){ MP_OBJ_NEW_QSTR(MP_QSTR_fill_rect), MP_OBJ_FROM_PTR(&framebuf_fill_rect_obj) };
|
||||
framebuf_locals_dict_table[2] = (mp_map_elem_t){ MP_OBJ_NEW_QSTR(MP_QSTR_pixel), MP_OBJ_FROM_PTR(&framebuf_pixel_obj) };
|
||||
@ -33,7 +33,7 @@ mp_obj_t mpy_init(mp_obj_fun_bc_t *self, size_t n_args, size_t n_kw, mp_obj_t *a
|
||||
framebuf_locals_dict_table[8] = (mp_map_elem_t){ MP_OBJ_NEW_QSTR(MP_QSTR_blit), MP_OBJ_FROM_PTR(&framebuf_blit_obj) };
|
||||
framebuf_locals_dict_table[9] = (mp_map_elem_t){ MP_OBJ_NEW_QSTR(MP_QSTR_scroll), MP_OBJ_FROM_PTR(&framebuf_scroll_obj) };
|
||||
framebuf_locals_dict_table[10] = (mp_map_elem_t){ MP_OBJ_NEW_QSTR(MP_QSTR_text), MP_OBJ_FROM_PTR(&framebuf_text_obj) };
|
||||
MP_OBJ_TYPE_SET_SLOT(&mp_type_framebuf, locals_dict, (void*)&framebuf_locals_dict, 1);
|
||||
MP_OBJ_TYPE_SET_SLOT(&mp_type_framebuf, locals_dict, (void*)&framebuf_locals_dict, 2);
|
||||
|
||||
mp_store_global(MP_QSTR_FrameBuffer, MP_OBJ_FROM_PTR(&mp_type_framebuf));
|
||||
mp_store_global(MP_QSTR_FrameBuffer1, MP_OBJ_FROM_PTR(&legacy_framebuffer1_obj));
|
||||
|
@ -20,12 +20,12 @@ mp_obj_t mpy_init(mp_obj_fun_bc_t *self, size_t n_args, size_t n_kw, mp_obj_t *a
|
||||
|
||||
decompio_type.base.type = mp_fun_table.type_type;
|
||||
decompio_type.name = MP_QSTR_DecompIO;
|
||||
decompio_type.make_new = &decompio_make_new;
|
||||
MP_OBJ_TYPE_SET_SLOT(&decompio_type, protocol, &decompio_stream_p, 0);
|
||||
MP_OBJ_TYPE_SET_SLOT(&decompio_type, make_new, &decompio_make_new, 0);
|
||||
MP_OBJ_TYPE_SET_SLOT(&decompio_type, protocol, &decompio_stream_p, 1);
|
||||
decompio_locals_dict_table[0] = (mp_map_elem_t){ MP_OBJ_NEW_QSTR(MP_QSTR_read), MP_OBJ_FROM_PTR(&mp_stream_read_obj) };
|
||||
decompio_locals_dict_table[1] = (mp_map_elem_t){ MP_OBJ_NEW_QSTR(MP_QSTR_readinto), MP_OBJ_FROM_PTR(&mp_stream_readinto_obj) };
|
||||
decompio_locals_dict_table[2] = (mp_map_elem_t){ MP_OBJ_NEW_QSTR(MP_QSTR_readline), MP_OBJ_FROM_PTR(&mp_stream_unbuffered_readline_obj) };
|
||||
MP_OBJ_TYPE_SET_SLOT(&decompio_type, locals_dict, (void*)&decompio_locals_dict, 1);
|
||||
MP_OBJ_TYPE_SET_SLOT(&decompio_type, locals_dict, (void*)&decompio_locals_dict, 2);
|
||||
|
||||
mp_store_global(MP_QSTR___name__, MP_OBJ_NEW_QSTR(MP_QSTR_uzlib));
|
||||
mp_store_global(MP_QSTR_decompress, MP_OBJ_FROM_PTR(&mod_uzlib_decompress_obj));
|
||||
|
@ -734,7 +734,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
mp_machine_soft_i2c_type,
|
||||
MP_QSTR_SoftI2C,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
mp_machine_soft_i2c_make_new,
|
||||
make_new, mp_machine_soft_i2c_make_new,
|
||||
print, mp_machine_soft_i2c_print,
|
||||
protocol, &mp_machine_soft_i2c_p,
|
||||
locals_dict, &mp_machine_i2c_locals_dict
|
||||
|
@ -38,7 +38,7 @@
|
||||
--n_args; \
|
||||
++all_args; \
|
||||
} \
|
||||
return mp_machine_soft_i2c_type.make_new(&mp_machine_soft_i2c_type, n_args, n_kw, all_args); \
|
||||
return MP_OBJ_TYPE_GET_SLOT(&mp_machine_soft_i2c_type, make_new)(&mp_machine_soft_i2c_type, n_args, n_kw, all_args); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
@ -105,7 +105,6 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_mem_type,
|
||||
MP_QSTR_mem,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
MP_TYPE_NULL_MAKE_NEW,
|
||||
print, machine_mem_print,
|
||||
subscr, machine_mem_subscr
|
||||
);
|
||||
|
@ -81,7 +81,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_pinbase_type,
|
||||
MP_QSTR_PinBase,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
pinbase_make_new,
|
||||
make_new, pinbase_make_new,
|
||||
protocol, &pinbase_pin_p
|
||||
);
|
||||
|
||||
|
@ -136,7 +136,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_pwm_type,
|
||||
MP_QSTR_PWM,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
mp_machine_pwm_make_new,
|
||||
make_new, mp_machine_pwm_make_new,
|
||||
print, mp_machine_pwm_print,
|
||||
locals_dict, &machine_pwm_locals_dict
|
||||
);
|
||||
|
@ -176,7 +176,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_signal_type,
|
||||
MP_QSTR_Signal,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
signal_make_new,
|
||||
make_new, signal_make_new,
|
||||
call, signal_call,
|
||||
protocol, &signal_pin_p,
|
||||
locals_dict, &signal_locals_dict
|
||||
|
@ -255,7 +255,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
mp_machine_soft_spi_type,
|
||||
MP_QSTR_SoftSPI,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
mp_machine_soft_spi_make_new,
|
||||
make_new, mp_machine_soft_spi_make_new,
|
||||
print, mp_machine_soft_spi_print,
|
||||
protocol, &mp_machine_soft_spi_p,
|
||||
locals_dict, &mp_machine_spi_locals_dict
|
||||
|
@ -39,7 +39,7 @@
|
||||
--n_args; \
|
||||
++all_args; \
|
||||
} \
|
||||
return mp_machine_soft_spi_type.make_new(&mp_machine_soft_spi_type, n_args, n_kw, all_args); \
|
||||
return MP_OBJ_TYPE_GET_SLOT(&mp_machine_soft_spi_type, make_new)(&mp_machine_soft_spi_type, n_args, n_kw, all_args); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
@ -244,7 +244,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
mp_type_bluetooth_uuid,
|
||||
MP_QSTR_UUID,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
bluetooth_uuid_make_new,
|
||||
make_new, bluetooth_uuid_make_new,
|
||||
unary_op, bluetooth_uuid_unary_op,
|
||||
binary_op, bluetooth_uuid_binary_op,
|
||||
print, bluetooth_uuid_print,
|
||||
@ -980,7 +980,7 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
|
||||
mp_type_bluetooth_ble,
|
||||
MP_QSTR_BLE,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
bluetooth_ble_make_new,
|
||||
make_new, bluetooth_ble_make_new,
|
||||
locals_dict, &bluetooth_ble_locals_dict
|
||||
);
|
||||
|
||||
|
@ -328,7 +328,6 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
|
||||
btree_type,
|
||||
MP_QSTR_btree,
|
||||
MP_TYPE_FLAG_ITER_IS_CUSTOM,
|
||||
MP_TYPE_NULL_MAKE_NEW,
|
||||
// Save on qstr's, reuse same as for module
|
||||
print, btree_print,
|
||||
iter, &btree_getiter_iternext,
|
||||
|
@ -833,7 +833,7 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
|
||||
mp_type_framebuf,
|
||||
MP_QSTR_FrameBuffer,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
framebuf_make_new,
|
||||
make_new, framebuf_make_new,
|
||||
buffer, framebuf_get_buffer,
|
||||
locals_dict, &framebuf_locals_dict
|
||||
);
|
||||
|
@ -181,7 +181,7 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
|
||||
lwip_slip_type,
|
||||
MP_QSTR_slip,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
lwip_slip_make_new,
|
||||
make_new, lwip_slip_make_new,
|
||||
locals_dict, &lwip_slip_locals_dict
|
||||
);
|
||||
|
||||
@ -1599,7 +1599,7 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
|
||||
lwip_socket_type,
|
||||
MP_QSTR_socket,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
lwip_socket_make_new,
|
||||
make_new, lwip_socket_make_new,
|
||||
print, lwip_socket_print,
|
||||
protocol, &lwip_socket_stream_p,
|
||||
locals_dict, &lwip_socket_locals_dict
|
||||
|
@ -148,7 +148,7 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
|
||||
task_queue_type,
|
||||
MP_QSTR_TaskQueue,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
task_queue_make_new,
|
||||
make_new, task_queue_make_new,
|
||||
locals_dict, &task_queue_locals_dict
|
||||
);
|
||||
|
||||
@ -296,7 +296,7 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
|
||||
task_type,
|
||||
MP_QSTR_Task,
|
||||
MP_TYPE_FLAG_ITER_IS_CUSTOM,
|
||||
task_make_new,
|
||||
make_new, task_make_new,
|
||||
attr, task_attr,
|
||||
iter, &task_getiter_iternext
|
||||
);
|
||||
|
@ -352,7 +352,7 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
|
||||
ucryptolib_aes_type,
|
||||
MP_QSTR_aes,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
ucryptolib_aes_make_new,
|
||||
make_new, ucryptolib_aes_make_new,
|
||||
locals_dict, &ucryptolib_aes_locals_dict
|
||||
);
|
||||
|
||||
|
@ -638,7 +638,7 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
|
||||
uctypes_struct_type,
|
||||
MP_QSTR_struct,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
uctypes_struct_make_new,
|
||||
make_new, uctypes_struct_make_new,
|
||||
print, uctypes_struct_print,
|
||||
attr, uctypes_struct_attr,
|
||||
subscr, uctypes_struct_subscr,
|
||||
|
@ -161,7 +161,7 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
|
||||
uhashlib_sha256_type,
|
||||
MP_QSTR_sha256,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
uhashlib_sha256_make_new,
|
||||
make_new, uhashlib_sha256_make_new,
|
||||
locals_dict, &uhashlib_sha256_locals_dict
|
||||
);
|
||||
#endif
|
||||
@ -255,7 +255,7 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
|
||||
uhashlib_sha1_type,
|
||||
MP_QSTR_sha1,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
uhashlib_sha1_make_new,
|
||||
make_new, uhashlib_sha1_make_new,
|
||||
locals_dict, &uhashlib_sha1_locals_dict
|
||||
);
|
||||
#endif
|
||||
@ -349,7 +349,7 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
|
||||
uhashlib_md5_type,
|
||||
MP_QSTR_md5,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
uhashlib_md5_make_new,
|
||||
make_new, uhashlib_md5_make_new,
|
||||
locals_dict, &uhashlib_md5_locals_dict
|
||||
);
|
||||
#endif // MICROPY_PY_UHASHLIB_MD5
|
||||
|
@ -183,7 +183,6 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
|
||||
match_type,
|
||||
MP_QSTR_match,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
MP_TYPE_NULL_MAKE_NEW,
|
||||
print, match_print,
|
||||
locals_dict, &match_locals_dict
|
||||
);
|
||||
@ -417,7 +416,6 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
|
||||
re_type,
|
||||
MP_QSTR_ure,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
MP_TYPE_NULL_MAKE_NEW,
|
||||
print, re_print,
|
||||
locals_dict, &re_locals_dict
|
||||
);
|
||||
|
@ -340,7 +340,6 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
|
||||
mp_type_poll,
|
||||
MP_QSTR_poll,
|
||||
MP_TYPE_FLAG_ITER_IS_ITERNEXT,
|
||||
MP_TYPE_NULL_MAKE_NEW,
|
||||
iter, poll_iternext,
|
||||
locals_dict, &poll_locals_dict
|
||||
);
|
||||
|
@ -532,7 +532,7 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
|
||||
socket_type,
|
||||
MP_QSTR_socket,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
socket_make_new,
|
||||
make_new, socket_make_new,
|
||||
protocol, &socket_stream_p,
|
||||
locals_dict, &socket_locals_dict,
|
||||
print, socket_print
|
||||
|
@ -318,7 +318,6 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
|
||||
ussl_socket_type,
|
||||
MP_QSTR_ussl,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
MP_TYPE_NULL_MAKE_NEW,
|
||||
// Save on qstr's, reuse same as for module
|
||||
print, ussl_socket_print,
|
||||
protocol, &ussl_socket_stream_p,
|
||||
|
@ -396,7 +396,6 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
|
||||
ussl_socket_type,
|
||||
MP_QSTR_ussl,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
MP_TYPE_NULL_MAKE_NEW,
|
||||
// Save on qstr's, reuse same as for module
|
||||
print, socket_print,
|
||||
protocol, &ussl_socket_stream_p,
|
||||
|
@ -213,7 +213,7 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
|
||||
utimeq_type,
|
||||
MP_QSTR_utimeq,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
utimeq_make_new,
|
||||
make_new, utimeq_make_new,
|
||||
unary_op, utimeq_unary_op,
|
||||
locals_dict, &utimeq_locals_dict
|
||||
);
|
||||
|
@ -294,7 +294,7 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
|
||||
websocket_type,
|
||||
MP_QSTR_websocket,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
websocket_make_new,
|
||||
make_new, websocket_make_new,
|
||||
protocol, &websocket_stream_p,
|
||||
locals_dict, &websocket_locals_dict
|
||||
);
|
||||
|
@ -144,7 +144,7 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
|
||||
decompio_type,
|
||||
MP_QSTR_DecompIO,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
decompio_make_new,
|
||||
make_new, decompio_make_new,
|
||||
protocol, &decompio_stream_p,
|
||||
locals_dict, &decompio_locals_dict
|
||||
);
|
||||
|
@ -346,7 +346,7 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
|
||||
webrepl_type,
|
||||
MP_QSTR__webrepl,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
webrepl_make_new,
|
||||
make_new, webrepl_make_new,
|
||||
protocol, &webrepl_stream_p,
|
||||
locals_dict, &webrepl_locals_dict
|
||||
);
|
||||
|
@ -500,7 +500,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
mp_network_cyw43_type,
|
||||
MP_QSTR_CYW43,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
network_cyw43_make_new,
|
||||
make_new, network_cyw43_make_new,
|
||||
print, network_cyw43_print,
|
||||
locals_dict, &network_cyw43_locals_dict
|
||||
);
|
||||
|
@ -159,7 +159,7 @@ STATIC mp_obj_t network_ninaw10_active(size_t n_args, const mp_obj_t *args) {
|
||||
MP_OBJ_NEW_QSTR(MP_QSTR_freq), MP_OBJ_NEW_SMALL_INT(10),
|
||||
MP_OBJ_NEW_QSTR(MP_QSTR_callback), MP_OBJ_FROM_PTR(&network_ninaw10_timer_callback_obj),
|
||||
};
|
||||
MP_STATE_PORT(mp_wifi_timer) = machine_timer_type.make_new((mp_obj_t)&machine_timer_type, 0, 2, timer_args);
|
||||
MP_STATE_PORT(mp_wifi_timer) = MP_OBJ_TYPE_GET_SLOT(&machine_timer_type, make_new)((mp_obj_t)&machine_timer_type, 0, 2, timer_args);
|
||||
}
|
||||
} else {
|
||||
nina_deinit();
|
||||
@ -778,7 +778,7 @@ STATIC MP_DEFINE_CONST_OBJ_FULL_TYPE(
|
||||
mod_network_nic_type_nina_base,
|
||||
MP_QSTR_nina,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
network_ninaw10_make_new,
|
||||
make_new, network_ninaw10_make_new,
|
||||
locals_dict, &nina_locals_dict
|
||||
);
|
||||
|
||||
|
@ -708,7 +708,7 @@ STATIC mp_obj_t wiznet5k_make_new(const mp_obj_type_t *type, size_t n_args, size
|
||||
MP_ROM_QSTR(MP_QSTR_miso), mp_pin_make_new(NULL, 1, 0, &miso_obj),
|
||||
MP_ROM_QSTR(MP_QSTR_mosi), mp_pin_make_new(NULL, 1, 0, &mosi_obj),
|
||||
};
|
||||
spi = MP_OBJ_TO_PTR(machine_spi_type.make_new((mp_obj_t)&machine_spi_type, 2, 3, args));
|
||||
spi = MP_OBJ_TO_PTR(MP_OBJ_TYPE_GET_SLOT(&machine_spi_type, make_new)((mp_obj_t)&machine_spi_type, 2, 3, args));
|
||||
|
||||
cs = mp_hal_get_pin_obj(mp_pin_make_new(NULL, 1, 0, (mp_obj_t[]) {MP_OBJ_NEW_SMALL_INT(MICROPY_HW_WIZNET_PIN_CS)}));
|
||||
rst = mp_hal_get_pin_obj(mp_pin_make_new(NULL, 1, 0, (mp_obj_t[]) {MP_OBJ_NEW_SMALL_INT(MICROPY_HW_WIZNET_PIN_RST)}));
|
||||
@ -1020,7 +1020,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
mod_network_nic_type_wiznet5k,
|
||||
MP_QSTR_WIZNET5K,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
wiznet5k_make_new,
|
||||
make_new, wiznet5k_make_new,
|
||||
locals_dict, &wiznet5k_locals_dict
|
||||
);
|
||||
#else // WIZNET5K_PROVIDED_STACK
|
||||
@ -1028,7 +1028,7 @@ STATIC MP_DEFINE_CONST_OBJ_FULL_TYPE(
|
||||
mod_network_nic_type_wiznet5k_base,
|
||||
MP_QSTR_WIZNET5K,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
wiznet5k_make_new,
|
||||
make_new, wiznet5k_make_new,
|
||||
locals_dict, &wiznet5k_locals_dict
|
||||
);
|
||||
|
||||
|
@ -173,7 +173,7 @@ STATIC mp_obj_t mp_vfs_autodetect(mp_obj_t bdev_obj) {
|
||||
#if MICROPY_VFS_LFS1
|
||||
if (memcmp(&buf[32], "littlefs", 8) == 0) {
|
||||
// LFS1
|
||||
mp_obj_t vfs = mp_type_vfs_lfs1.make_new(&mp_type_vfs_lfs1, 1, 0, &bdev_obj);
|
||||
mp_obj_t vfs = MP_OBJ_TYPE_GET_SLOT(&mp_type_vfs_lfs1, make_new)(&mp_type_vfs_lfs1, 1, 0, &bdev_obj);
|
||||
nlr_pop();
|
||||
return vfs;
|
||||
}
|
||||
@ -181,7 +181,7 @@ STATIC mp_obj_t mp_vfs_autodetect(mp_obj_t bdev_obj) {
|
||||
#if MICROPY_VFS_LFS2
|
||||
if (memcmp(&buf[0], "littlefs", 8) == 0) {
|
||||
// LFS2
|
||||
mp_obj_t vfs = mp_type_vfs_lfs2.make_new(&mp_type_vfs_lfs2, 1, 0, &bdev_obj);
|
||||
mp_obj_t vfs = MP_OBJ_TYPE_GET_SLOT(&mp_type_vfs_lfs2, make_new)(&mp_type_vfs_lfs2, 1, 0, &bdev_obj);
|
||||
nlr_pop();
|
||||
return vfs;
|
||||
}
|
||||
@ -194,7 +194,7 @@ STATIC mp_obj_t mp_vfs_autodetect(mp_obj_t bdev_obj) {
|
||||
#endif
|
||||
|
||||
#if MICROPY_VFS_FAT
|
||||
return mp_fat_vfs_type.make_new(&mp_fat_vfs_type, 1, 0, &bdev_obj);
|
||||
return MP_OBJ_TYPE_GET_SLOT(&mp_fat_vfs_type, make_new)(&mp_fat_vfs_type, 1, 0, &bdev_obj);
|
||||
#endif
|
||||
|
||||
// no filesystem found
|
||||
|
@ -435,7 +435,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
mp_fat_vfs_type,
|
||||
MP_QSTR_VfsFat,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
fat_vfs_make_new,
|
||||
make_new, fat_vfs_make_new,
|
||||
protocol, &fat_vfs_proto,
|
||||
locals_dict, &fat_vfs_locals_dict
|
||||
);
|
||||
|
@ -180,7 +180,6 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
mp_type_vfs_fat_fileio,
|
||||
MP_QSTR_FileIO,
|
||||
MP_TYPE_FLAG_ITER_IS_STREAM,
|
||||
MP_TYPE_NULL_MAKE_NEW,
|
||||
print, file_obj_print,
|
||||
protocol, &vfs_fat_fileio_stream_p,
|
||||
locals_dict, &vfs_fat_rawfile_locals_dict
|
||||
@ -197,7 +196,6 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
mp_type_vfs_fat_textio,
|
||||
MP_QSTR_TextIOWrapper,
|
||||
MP_TYPE_FLAG_ITER_IS_STREAM,
|
||||
MP_TYPE_NULL_MAKE_NEW,
|
||||
print, file_obj_print,
|
||||
protocol, &vfs_fat_textio_stream_p,
|
||||
locals_dict, &vfs_fat_rawfile_locals_dict
|
||||
|
@ -512,7 +512,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
MP_TYPE_VFS_LFSx,
|
||||
VFS_LFSx_QSTR,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
MP_VFS_LFSx(make_new),
|
||||
make_new, MP_VFS_LFSx(make_new),
|
||||
protocol, &MP_VFS_LFSx(proto),
|
||||
locals_dict, &MP_VFS_LFSx(locals_dict)
|
||||
);
|
||||
|
@ -224,7 +224,6 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
MP_TYPE_VFS_LFSx_(_fileio),
|
||||
MP_QSTR_FileIO,
|
||||
MP_TYPE_FLAG_ITER_IS_STREAM,
|
||||
MP_TYPE_NULL_MAKE_NEW,
|
||||
print, MP_VFS_LFSx(file_print),
|
||||
protocol, &MP_VFS_LFSx(fileio_stream_p),
|
||||
locals_dict, &MP_VFS_LFSx(file_locals_dict)
|
||||
@ -241,7 +240,6 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
MP_TYPE_VFS_LFSx_(_textio),
|
||||
MP_QSTR_TextIOWrapper,
|
||||
MP_TYPE_FLAG_ITER_IS_STREAM,
|
||||
MP_TYPE_NULL_MAKE_NEW,
|
||||
print, MP_VFS_LFSx(file_print),
|
||||
protocol, &MP_VFS_LFSx(textio_stream_p),
|
||||
locals_dict, &MP_VFS_LFSx(file_locals_dict)
|
||||
|
@ -402,7 +402,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
mp_type_vfs_posix,
|
||||
MP_QSTR_VfsPosix,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
vfs_posix_make_new,
|
||||
make_new, vfs_posix_make_new,
|
||||
protocol, &vfs_posix_proto,
|
||||
locals_dict, &vfs_posix_locals_dict
|
||||
);
|
||||
|
@ -253,7 +253,6 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
mp_type_vfs_posix_fileio,
|
||||
MP_QSTR_FileIO,
|
||||
MP_TYPE_FLAG_ITER_IS_STREAM,
|
||||
MP_TYPE_NULL_MAKE_NEW,
|
||||
print, vfs_posix_file_print,
|
||||
protocol, &vfs_posix_fileio_stream_p,
|
||||
locals_dict, &vfs_posix_rawfile_locals_dict
|
||||
@ -270,7 +269,6 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
mp_type_vfs_posix_textio,
|
||||
MP_QSTR_TextIOWrapper,
|
||||
MP_TYPE_FLAG_ITER_IS_STREAM,
|
||||
MP_TYPE_NULL_MAKE_NEW,
|
||||
print, vfs_posix_file_print,
|
||||
protocol, &vfs_posix_textio_stream_p,
|
||||
locals_dict, &vfs_posix_rawfile_locals_dict
|
||||
|
@ -194,7 +194,6 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
mp_irq_type,
|
||||
MP_QSTR_irq,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
MP_TYPE_NULL_MAKE_NEW,
|
||||
call, mp_irq_call,
|
||||
locals_dict, &mp_irq_locals_dict
|
||||
);
|
||||
|
@ -175,7 +175,7 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
|
||||
network_server_type,
|
||||
MP_QSTR_Server,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
network_server_make_new,
|
||||
make_new, network_server_make_new,
|
||||
locals_dict, &network_server_locals_dict
|
||||
);
|
||||
#endif
|
||||
|
@ -181,7 +181,7 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
|
||||
sha1_type,
|
||||
MP_QSTR_sha1,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
hash_make_new,
|
||||
make_new, hash_make_new,
|
||||
locals_dict, &hash_locals_dict
|
||||
);
|
||||
|
||||
@ -189,7 +189,7 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
|
||||
sha256_type,
|
||||
MP_QSTR_sha256,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
hash_make_new,
|
||||
make_new, hash_make_new,
|
||||
locals_dict, &hash_locals_dict
|
||||
);
|
||||
|
||||
|
@ -763,7 +763,7 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
|
||||
socket_type,
|
||||
MP_QSTR_socket,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
socket_make_new,
|
||||
make_new, socket_make_new,
|
||||
protocol, &socket_stream_p,
|
||||
locals_dict, &socket_locals_dict
|
||||
);
|
||||
|
@ -1289,7 +1289,7 @@ STATIC MP_DEFINE_CONST_OBJ_FULL_TYPE(
|
||||
mod_network_nic_type_wlan_base,
|
||||
MP_QSTR_WLAN,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
wlan_make_new,
|
||||
make_new, wlan_make_new,
|
||||
locals_dict, &wlan_locals_dict
|
||||
);
|
||||
|
||||
|
@ -237,7 +237,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
pyb_adc_type,
|
||||
MP_QSTR_ADC,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
adc_make_new,
|
||||
make_new, adc_make_new,
|
||||
print, adc_print,
|
||||
locals_dict, &adc_locals_dict
|
||||
);
|
||||
@ -305,7 +305,6 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
|
||||
pyb_adc_channel_type,
|
||||
MP_QSTR_ADCChannel,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
MP_TYPE_NULL_MAKE_NEW,
|
||||
print, adc_channel_print,
|
||||
call, adc_channel_call,
|
||||
locals_dict, &adc_channel_locals_dict
|
||||
|
@ -88,7 +88,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
pyb_flash_type,
|
||||
MP_QSTR_Flash,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
pyb_flash_make_new,
|
||||
make_new, pyb_flash_make_new,
|
||||
locals_dict, &pyb_flash_locals_dict
|
||||
);
|
||||
|
||||
|
@ -525,7 +525,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
pyb_i2c_type,
|
||||
MP_QSTR_I2C,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
pyb_i2c_make_new,
|
||||
make_new, pyb_i2c_make_new,
|
||||
print, pyb_i2c_print,
|
||||
locals_dict, &pyb_i2c_locals_dict
|
||||
);
|
||||
|
@ -935,7 +935,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
pin_type,
|
||||
MP_QSTR_Pin,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
pin_make_new,
|
||||
make_new, pin_make_new,
|
||||
print, pin_print,
|
||||
call, pin_call,
|
||||
locals_dict, &pin_locals_dict
|
||||
@ -957,7 +957,6 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
pin_board_pins_obj_type,
|
||||
MP_QSTR_board,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
MP_TYPE_NULL_MAKE_NEW,
|
||||
print, pin_named_pins_obj_print,
|
||||
locals_dict, &pin_board_pins_locals_dict
|
||||
);
|
||||
|
@ -473,7 +473,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
pyb_rtc_type,
|
||||
MP_QSTR_RTC,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
pyb_rtc_make_new,
|
||||
make_new, pyb_rtc_make_new,
|
||||
locals_dict, &pyb_rtc_locals_dict
|
||||
);
|
||||
|
||||
|
@ -216,6 +216,6 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
pyb_sd_type,
|
||||
MP_QSTR_SD,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
pyb_sd_make_new,
|
||||
make_new, pyb_sd_make_new,
|
||||
locals_dict, &pyb_sd_locals_dict
|
||||
);
|
||||
|
@ -128,8 +128,7 @@ STATIC pybsleep_wake_reason_t pybsleep_wake_reason = PYB_SLP_WAKED_PWRON;
|
||||
STATIC MP_DEFINE_CONST_OBJ_TYPE(
|
||||
pyb_sleep_type,
|
||||
MP_QSTR_sleep,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
MP_TYPE_NULL_MAKE_NEW
|
||||
MP_TYPE_FLAG_NONE
|
||||
);
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -381,7 +381,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
pyb_spi_type,
|
||||
MP_QSTR_SPI,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
pyb_spi_make_new,
|
||||
make_new, pyb_spi_make_new,
|
||||
print, pyb_spi_print,
|
||||
locals_dict, &pyb_spi_locals_dict
|
||||
);
|
||||
|
@ -463,7 +463,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
pyb_timer_type,
|
||||
MP_QSTR_Timer,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
pyb_timer_make_new,
|
||||
make_new, pyb_timer_make_new,
|
||||
print, pyb_timer_print,
|
||||
locals_dict, &pyb_timer_locals_dict
|
||||
);
|
||||
@ -726,7 +726,6 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
|
||||
pyb_timer_channel_type,
|
||||
MP_QSTR_TimerChannel,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
MP_TYPE_NULL_MAKE_NEW,
|
||||
print, pyb_timer_channel_print,
|
||||
locals_dict, &pyb_timer_channel_locals_dict
|
||||
);
|
||||
|
@ -689,7 +689,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
pyb_uart_type,
|
||||
MP_QSTR_UART,
|
||||
MP_TYPE_FLAG_ITER_IS_STREAM,
|
||||
pyb_uart_make_new,
|
||||
make_new, pyb_uart_make_new,
|
||||
print, pyb_uart_print,
|
||||
protocol, &uart_stream_p,
|
||||
locals_dict, &pyb_uart_locals_dict
|
||||
|
@ -154,7 +154,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
pyb_wdt_type,
|
||||
MP_QSTR_WDT,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
pyb_wdt_make_new,
|
||||
make_new, pyb_wdt_make_new,
|
||||
locals_dict, &pybwdt_locals_dict
|
||||
);
|
||||
|
||||
|
@ -145,7 +145,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
esp32_nvs_type,
|
||||
MP_QSTR_NVS,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
esp32_nvs_make_new,
|
||||
make_new, esp32_nvs_make_new,
|
||||
print, esp32_nvs_print,
|
||||
locals_dict, &esp32_nvs_locals_dict
|
||||
);
|
||||
|
@ -288,7 +288,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
esp32_partition_type,
|
||||
MP_QSTR_Partition,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
esp32_partition_make_new,
|
||||
make_new, esp32_partition_make_new,
|
||||
print, esp32_partition_print,
|
||||
locals_dict, &esp32_partition_locals_dict
|
||||
);
|
||||
|
@ -376,7 +376,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
esp32_rmt_type,
|
||||
MP_QSTR_RMT,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
esp32_rmt_make_new,
|
||||
make_new, esp32_rmt_make_new,
|
||||
print, esp32_rmt_print,
|
||||
locals_dict, &esp32_rmt_locals_dict
|
||||
);
|
||||
|
@ -95,7 +95,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
esp32_ulp_type,
|
||||
MP_QSTR_ULP,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
esp32_ulp_make_new,
|
||||
make_new, esp32_ulp_make_new,
|
||||
locals_dict, &esp32_ulp_locals_dict
|
||||
);
|
||||
|
||||
|
@ -260,7 +260,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_adc_type,
|
||||
MP_QSTR_ADC,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
madc_make_new,
|
||||
make_new, madc_make_new,
|
||||
print, madc_print,
|
||||
locals_dict, &madc_locals_dict
|
||||
);
|
||||
|
@ -198,7 +198,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_adcblock_type,
|
||||
MP_QSTR_ADCBlock,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
madcblock_make_new,
|
||||
make_new, madcblock_make_new,
|
||||
print, madcblock_print,
|
||||
locals_dict, &madcblock_locals_dict
|
||||
);
|
||||
|
@ -108,7 +108,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_dac_type,
|
||||
MP_QSTR_DAC,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
mdac_make_new,
|
||||
make_new, mdac_make_new,
|
||||
print, mdac_print,
|
||||
locals_dict, &mdac_locals_dict
|
||||
);
|
||||
|
@ -549,7 +549,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_hw_spi_type,
|
||||
MP_QSTR_SPI,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
machine_hw_spi_make_new,
|
||||
make_new, machine_hw_spi_make_new,
|
||||
print, machine_hw_spi_print,
|
||||
protocol, &machine_hw_spi_p,
|
||||
locals_dict, &mp_machine_spi_locals_dict
|
||||
|
@ -196,7 +196,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_hw_i2c_type,
|
||||
MP_QSTR_I2C,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
machine_hw_i2c_make_new,
|
||||
make_new, machine_hw_i2c_make_new,
|
||||
print, machine_hw_i2c_print,
|
||||
protocol, &machine_hw_i2c_p,
|
||||
locals_dict, &mp_machine_i2c_locals_dict
|
||||
|
@ -833,7 +833,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_i2s_type,
|
||||
MP_QSTR_I2S,
|
||||
MP_TYPE_FLAG_ITER_IS_STREAM,
|
||||
machine_i2s_make_new,
|
||||
make_new, machine_i2s_make_new,
|
||||
print, machine_i2s_print,
|
||||
protocol, &i2s_stream_p,
|
||||
locals_dict, &machine_i2s_locals_dict
|
||||
|
@ -533,7 +533,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_pin_type,
|
||||
MP_QSTR_Pin,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
mp_pin_make_new,
|
||||
make_new, mp_pin_make_new,
|
||||
print, machine_pin_print,
|
||||
call, machine_pin_call,
|
||||
protocol, &pin_pin_p,
|
||||
@ -728,7 +728,6 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_pin_irq_type,
|
||||
MP_QSTR_IRQ,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
MP_TYPE_NULL_MAKE_NEW,
|
||||
call, machine_pin_irq_call,
|
||||
locals_dict, &machine_pin_irq_locals_dict
|
||||
);
|
||||
|
@ -177,6 +177,6 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_rtc_type,
|
||||
MP_QSTR_RTC,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
machine_rtc_make_new,
|
||||
make_new, machine_rtc_make_new,
|
||||
locals_dict, &machine_rtc_locals_dict
|
||||
);
|
||||
|
@ -403,7 +403,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_sdcard_type,
|
||||
MP_QSTR_SDCard,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
machine_sdcard_make_new,
|
||||
make_new, machine_sdcard_make_new,
|
||||
locals_dict, &machine_sdcard_locals_dict
|
||||
);
|
||||
|
||||
|
@ -281,7 +281,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_timer_type,
|
||||
MP_QSTR_Timer,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
machine_timer_make_new,
|
||||
make_new, machine_timer_make_new,
|
||||
print, machine_timer_print,
|
||||
locals_dict, &machine_timer_locals_dict
|
||||
);
|
||||
|
@ -138,7 +138,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_touchpad_type,
|
||||
MP_QSTR_TouchPad,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
mtp_make_new,
|
||||
make_new, mtp_make_new,
|
||||
locals_dict, &mtp_locals_dict
|
||||
);
|
||||
|
||||
|
@ -534,7 +534,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_uart_type,
|
||||
MP_QSTR_UART,
|
||||
MP_TYPE_FLAG_ITER_IS_STREAM,
|
||||
machine_uart_make_new,
|
||||
make_new, machine_uart_make_new,
|
||||
print, machine_uart_print,
|
||||
protocol, &uart_stream_p,
|
||||
locals_dict, &machine_uart_locals_dict
|
||||
|
@ -87,6 +87,6 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_wdt_type,
|
||||
MP_QSTR_WDT,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
machine_wdt_make_new,
|
||||
make_new, machine_wdt_make_new,
|
||||
locals_dict, &machine_wdt_locals_dict
|
||||
);
|
||||
|
@ -789,7 +789,7 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
|
||||
socket_type,
|
||||
MP_QSTR_socket,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
socket_make_new,
|
||||
make_new, socket_make_new,
|
||||
protocol, &socket_stream_p,
|
||||
locals_dict, &socket_locals_dict
|
||||
);
|
||||
|
@ -306,7 +306,6 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
lan_if_type,
|
||||
MP_QSTR_LAN,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
MP_TYPE_NULL_MAKE_NEW,
|
||||
locals_dict, &lan_if_locals_dict
|
||||
);
|
||||
|
||||
|
@ -282,6 +282,5 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
ppp_if_type,
|
||||
MP_QSTR_PPP,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
MP_TYPE_NULL_MAKE_NEW,
|
||||
locals_dict, &ppp_if_locals_dict
|
||||
);
|
||||
|
@ -619,7 +619,6 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
wlan_if_type,
|
||||
MP_QSTR_WLAN,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
MP_TYPE_NULL_MAKE_NEW,
|
||||
locals_dict, &wlan_if_locals_dict
|
||||
);
|
||||
|
||||
|
@ -93,7 +93,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_adc_type,
|
||||
MP_QSTR_ADC,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
machine_adc_make_new,
|
||||
make_new, machine_adc_make_new,
|
||||
print, machine_adc_print,
|
||||
locals_dict, &machine_adc_locals_dict
|
||||
);
|
||||
|
@ -179,7 +179,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_hspi_type,
|
||||
MP_QSTR_HSPI,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
machine_hspi_make_new,
|
||||
make_new, machine_hspi_make_new,
|
||||
print, machine_hspi_print,
|
||||
protocol, &machine_hspi_p,
|
||||
locals_dict, &mp_machine_spi_locals_dict
|
||||
|
@ -454,7 +454,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
pyb_pin_type,
|
||||
MP_QSTR_Pin,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
mp_pin_make_new,
|
||||
make_new, mp_pin_make_new,
|
||||
print, pyb_pin_print,
|
||||
call, pyb_pin_call,
|
||||
protocol, &pin_pin_p,
|
||||
@ -514,7 +514,6 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE(
|
||||
pin_irq_type,
|
||||
MP_QSTR_IRQ,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
MP_TYPE_NULL_MAKE_NEW,
|
||||
call, pin_irq_call,
|
||||
locals_dict, &pin_irq_locals_dict
|
||||
);
|
||||
|
@ -266,6 +266,6 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
pyb_rtc_type,
|
||||
MP_QSTR_RTC,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
pyb_rtc_make_new,
|
||||
make_new, pyb_rtc_make_new,
|
||||
locals_dict, &pyb_rtc_locals_dict
|
||||
);
|
||||
|
@ -347,7 +347,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
pyb_uart_type,
|
||||
MP_QSTR_UART,
|
||||
MP_TYPE_FLAG_ITER_IS_STREAM,
|
||||
pyb_uart_make_new,
|
||||
make_new, pyb_uart_make_new,
|
||||
print, pyb_uart_print,
|
||||
protocol, &uart_stream_p,
|
||||
locals_dict, &pyb_uart_locals_dict
|
||||
|
@ -73,6 +73,6 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
esp_wdt_type,
|
||||
MP_QSTR_WDT,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
machine_wdt_make_new,
|
||||
make_new, machine_wdt_make_new,
|
||||
locals_dict, &machine_wdt_locals_dict
|
||||
);
|
||||
|
@ -68,7 +68,7 @@ STATIC void mp_reset(void) {
|
||||
mp_obj_t args[2];
|
||||
args[0] = MP_OBJ_NEW_SMALL_INT(0);
|
||||
args[1] = MP_OBJ_NEW_SMALL_INT(115200);
|
||||
args[0] = pyb_uart_type.make_new(&pyb_uart_type, 2, 0, args);
|
||||
args[0] = MP_OBJ_TYPE_GET_SLOT(&pyb_uart_type, make_new)(&pyb_uart_type, 2, 0, args);
|
||||
args[1] = MP_OBJ_NEW_SMALL_INT(1);
|
||||
mp_uos_dupterm_obj.fun.var(2, args);
|
||||
}
|
||||
|
@ -341,7 +341,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
esp_timer_type,
|
||||
MP_QSTR_Timer,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
esp_timer_make_new,
|
||||
make_new, esp_timer_make_new,
|
||||
print, esp_timer_print,
|
||||
locals_dict, &esp_timer_locals_dict
|
||||
);
|
||||
|
@ -514,7 +514,6 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
wlan_if_type,
|
||||
MP_QSTR_WLAN,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
MP_TYPE_NULL_MAKE_NEW,
|
||||
locals_dict, &wlan_if_locals_dict
|
||||
);
|
||||
|
||||
|
@ -121,7 +121,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_adc_type,
|
||||
MP_QSTR_ADC,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
adc_obj_make_new,
|
||||
make_new, adc_obj_make_new,
|
||||
print, adc_obj_print,
|
||||
locals_dict, &adc_locals_dict
|
||||
);
|
||||
|
@ -201,7 +201,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_i2c_type,
|
||||
MP_QSTR_I2C,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
machine_i2c_make_new,
|
||||
make_new, machine_i2c_make_new,
|
||||
print, machine_i2c_print,
|
||||
protocol, &machine_i2c_p,
|
||||
locals_dict, &mp_machine_i2c_locals_dict
|
||||
|
@ -1217,7 +1217,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_i2s_type,
|
||||
MP_QSTR_I2S,
|
||||
MP_TYPE_FLAG_ITER_IS_STREAM,
|
||||
machine_i2s_make_new,
|
||||
make_new, machine_i2s_make_new,
|
||||
print, machine_i2s_print,
|
||||
protocol, &i2s_stream_p,
|
||||
locals_dict, &machine_i2s_locals_dict
|
||||
|
@ -84,7 +84,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_led_type,
|
||||
MP_QSTR_LED,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
led_obj_make_new,
|
||||
make_new, led_obj_make_new,
|
||||
print, led_obj_print,
|
||||
locals_dict, &led_locals_dict
|
||||
);
|
||||
|
@ -62,7 +62,6 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_pin_cpu_pins_obj_type,
|
||||
MP_QSTR_cpu,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
MP_TYPE_NULL_MAKE_NEW,
|
||||
locals_dict, &machine_pin_cpu_pins_locals_dict
|
||||
);
|
||||
|
||||
@ -70,7 +69,6 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_pin_board_pins_obj_type,
|
||||
MP_QSTR_board,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
MP_TYPE_NULL_MAKE_NEW,
|
||||
locals_dict, &machine_pin_board_pins_locals_dict
|
||||
);
|
||||
|
||||
@ -424,7 +422,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_pin_type,
|
||||
MP_QSTR_Pin,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
mp_pin_make_new,
|
||||
make_new, mp_pin_make_new,
|
||||
print, machine_pin_obj_print,
|
||||
call, machine_pin_obj_call,
|
||||
protocol, &machine_pin_obj_protocol,
|
||||
@ -436,7 +434,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_pin_af_type,
|
||||
MP_QSTR_PinAF,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
mp_pin_make_new,
|
||||
make_new, mp_pin_make_new,
|
||||
print, machine_pin_obj_print,
|
||||
locals_dict, &machine_pin_locals_dict
|
||||
);
|
||||
|
@ -170,6 +170,6 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_rtc_type,
|
||||
MP_QSTR_RTC,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
machine_rtc_make_new,
|
||||
make_new, machine_rtc_make_new,
|
||||
locals_dict, &machine_rtc_locals_dict
|
||||
);
|
||||
|
@ -212,7 +212,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_sdcard_type,
|
||||
MP_QSTR_SDCard,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
sdcard_obj_make_new,
|
||||
make_new, sdcard_obj_make_new,
|
||||
locals_dict, &sdcard_locals_dict
|
||||
);
|
||||
|
||||
|
@ -255,7 +255,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_spi_type,
|
||||
MP_QSTR_SPI,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
machine_spi_make_new,
|
||||
make_new, machine_spi_make_new,
|
||||
print, machine_spi_print,
|
||||
protocol, &machine_spi_p,
|
||||
locals_dict, &mp_machine_spi_locals_dict
|
||||
|
@ -215,7 +215,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_timer_type,
|
||||
MP_QSTR_Timer,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
machine_timer_make_new,
|
||||
make_new, machine_timer_make_new,
|
||||
print, machine_timer_print,
|
||||
locals_dict, &machine_timer_locals_dict
|
||||
);
|
||||
|
@ -473,7 +473,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_uart_type,
|
||||
MP_QSTR_UART,
|
||||
MP_TYPE_FLAG_ITER_IS_STREAM,
|
||||
machine_uart_make_new,
|
||||
make_new, machine_uart_make_new,
|
||||
print, machine_uart_print,
|
||||
protocol, &uart_stream_p,
|
||||
locals_dict, &machine_uart_locals_dict
|
||||
|
@ -103,6 +103,6 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_wdt_type,
|
||||
MP_QSTR_WDT,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
machine_wdt_make_new,
|
||||
make_new, machine_wdt_make_new,
|
||||
locals_dict, &machine_wdt_locals_dict
|
||||
);
|
||||
|
@ -219,6 +219,6 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
mimxrt_flash_type,
|
||||
MP_QSTR_Flash,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
mimxrt_flash_make_new,
|
||||
make_new, mimxrt_flash_make_new,
|
||||
locals_dict, &mimxrt_flash_locals_dict
|
||||
);
|
||||
|
@ -224,7 +224,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
network_lan_type,
|
||||
MP_QSTR_LAN,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
network_lan_make_new,
|
||||
make_new, network_lan_make_new,
|
||||
print, network_lan_print,
|
||||
locals_dict, &network_lan_locals_dict
|
||||
);
|
||||
|
@ -47,7 +47,6 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
microbit_repeat_iterator_type,
|
||||
MP_QSTR_iterator,
|
||||
MP_TYPE_FLAG_ITER_IS_ITERNEXT,
|
||||
MP_TYPE_NULL_MAKE_NEW,
|
||||
iter, microbit_repeat_iter_next
|
||||
);
|
||||
|
||||
|
@ -546,7 +546,6 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
microbit_display_type,
|
||||
MP_QSTR_MicroBitDisplay,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
MP_TYPE_NULL_MAKE_NEW,
|
||||
locals_dict, µbit_display_locals_dict
|
||||
);
|
||||
|
||||
|
@ -682,7 +682,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
microbit_image_type,
|
||||
MP_QSTR_MicroBitImage,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
microbit_image_make_new,
|
||||
make_new, microbit_image_make_new,
|
||||
print, microbit_image_print,
|
||||
binary_op, image_binary_op,
|
||||
locals_dict, µbit_image_locals_dict
|
||||
@ -832,7 +832,6 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
microbit_scrolling_string_iterator_type,
|
||||
MP_QSTR_iterator,
|
||||
MP_TYPE_FLAG_ITER_IS_ITERNEXT,
|
||||
MP_TYPE_NULL_MAKE_NEW,
|
||||
iter, microbit_scrolling_string_iter_next
|
||||
);
|
||||
|
||||
@ -912,7 +911,6 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
microbit_facade_iterator_type,
|
||||
MP_QSTR_iterator,
|
||||
MP_TYPE_FLAG_ITER_IS_ITERNEXT,
|
||||
MP_TYPE_NULL_MAKE_NEW,
|
||||
iter, microbit_facade_iter_next
|
||||
);
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user