mimxrt: 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 17:25:03 +10:00
parent 4274b34d6b
commit 7d79fd7e8b
3 changed files with 4 additions and 7 deletions

View File

@ -41,3 +41,5 @@ const mp_obj_module_t mp_module_mimxrt = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&mimxrt_module_globals,
};
MP_REGISTER_MODULE(MP_QSTR_mimxrt, mp_module_mimxrt, 1);

View File

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

View File

@ -228,9 +228,6 @@ static inline void restore_irq_pri(uint32_t basepri) {
#define MICROPY_PORT_BUILTINS \
{ MP_ROM_QSTR(MP_QSTR_open), MP_ROM_PTR(&mp_builtin_open_obj) },
extern const struct _mp_obj_module_t mp_module_mimxrt;
extern const struct _mp_obj_module_t mp_module_utime;
#if defined(MICROPY_HW_ETH_MDC)
extern const struct _mp_obj_type_t network_lan_type;
#define MICROPY_HW_NIC_ETH { MP_ROM_QSTR(MP_QSTR_LAN), MP_ROM_PTR(&network_lan_type) },
@ -238,10 +235,6 @@ extern const struct _mp_obj_type_t network_lan_type;
#define MICROPY_HW_NIC_ETH
#endif
#define MICROPY_PORT_BUILTIN_MODULES \
{ MP_ROM_QSTR(MP_QSTR_mimxrt), (mp_obj_t)&mp_module_mimxrt }, \
{ MP_ROM_QSTR(MP_QSTR_utime), MP_ROM_PTR(&mp_module_utime) }, \
#ifndef MICROPY_BOARD_NETWORK_INTERFACES
#define MICROPY_BOARD_NETWORK_INTERFACES
#endif