From c3f7424a5736fcae94c5855230eb029877c75c36 Mon Sep 17 00:00:00 2001 From: Jim Mussared Date: Wed, 20 Apr 2022 21:19:03 +1000 Subject: [PATCH] samd: Make port-specific modules use MP_REGISTER_MODULE. Signed-off-by: Jim Mussared --- ports/samd/modsamd.c | 2 ++ ports/samd/modutime.c | 2 ++ ports/samd/mpconfigport.h | 7 ------- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/ports/samd/modsamd.c b/ports/samd/modsamd.c index 1f91498080..387ced5cf5 100644 --- a/ports/samd/modsamd.c +++ b/ports/samd/modsamd.c @@ -39,3 +39,5 @@ const mp_obj_module_t mp_module_samd = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&samd_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_samd, mp_module_samd, 1); diff --git a/ports/samd/modutime.c b/ports/samd/modutime.c index 2d5ed0776d..0b872a297a 100644 --- a/ports/samd/modutime.c +++ b/ports/samd/modutime.c @@ -99,3 +99,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); diff --git a/ports/samd/mpconfigport.h b/ports/samd/mpconfigport.h index 54018f111e..613b8cd5a9 100644 --- a/ports/samd/mpconfigport.h +++ b/ports/samd/mpconfigport.h @@ -108,13 +108,6 @@ #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_samd; -extern const struct _mp_obj_module_t mp_module_utime; - -#define MICROPY_PORT_BUILTIN_MODULES \ - { MP_ROM_QSTR(MP_QSTR_samd), MP_ROM_PTR(&mp_module_samd) }, \ - { MP_ROM_QSTR(MP_QSTR_utime), MP_ROM_PTR(&mp_module_utime) }, \ - #define MICROPY_PORT_ROOT_POINTERS \ const char *readline_hist[8];