rp2: Make port-specific modules use MP_REGISTER_MODULE.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit is contained in:
Jim Mussared 2022-04-20 21:17:46 +10:00
parent 60c5968f99
commit 62f00a43d5
3 changed files with 4 additions and 7 deletions

View File

@ -42,3 +42,5 @@ const mp_obj_module_t mp_module_rp2 = {
.base = { &mp_type_module }, .base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&rp2_module_globals, .globals = (mp_obj_dict_t *)&rp2_module_globals,
}; };
MP_REGISTER_MODULE(MP_QSTR__rp2, mp_module_rp2, 1);

View File

@ -125,3 +125,5 @@ const mp_obj_module_t mp_module_utime = {
.base = { &mp_type_module }, .base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&mp_module_time_globals, .globals = (mp_obj_dict_t *)&mp_module_time_globals,
}; };
MP_REGISTER_MODULE(MP_QSTR_utime, mp_module_utime, 1);

View File

@ -134,9 +134,6 @@
#define MICROPY_PORT_BUILTINS \ #define MICROPY_PORT_BUILTINS \
{ MP_ROM_QSTR(MP_QSTR_open), MP_ROM_PTR(&mp_builtin_open_obj) }, { MP_ROM_QSTR(MP_QSTR_open), MP_ROM_PTR(&mp_builtin_open_obj) },
extern const struct _mp_obj_module_t mp_module_rp2;
extern const struct _mp_obj_module_t mp_module_utime;
#if MICROPY_PY_NETWORK #if MICROPY_PY_NETWORK
#define NETWORK_ROOT_POINTERS mp_obj_list_t mod_network_nic_list; #define NETWORK_ROOT_POINTERS mp_obj_list_t mod_network_nic_list;
#else #else
@ -171,10 +168,6 @@ extern const struct _mod_network_nic_type_t mod_network_nic_type_nina;
#define MICROPY_PORT_ROOT_POINTER_NINAW10 #define MICROPY_PORT_ROOT_POINTER_NINAW10
#endif #endif
#define MICROPY_PORT_BUILTIN_MODULES \
{ MP_OBJ_NEW_QSTR(MP_QSTR__rp2), (mp_obj_t)&mp_module_rp2 }, \
{ MP_ROM_QSTR(MP_QSTR_utime), MP_ROM_PTR(&mp_module_utime) }, \
#ifndef MICROPY_BOARD_NETWORK_INTERFACES #ifndef MICROPY_BOARD_NETWORK_INTERFACES
#define MICROPY_BOARD_NETWORK_INTERFACES #define MICROPY_BOARD_NETWORK_INTERFACES
#endif #endif