diff options
| author | Jim Mussared <jim.mussared@gmail.com> | 2022-04-20 17:22:57 +1000 |
|---|---|---|
| committer | Jim Mussared <jim.mussared@gmail.com> | 2022-05-18 20:56:30 +1000 |
| commit | 4274b34d6be19874d2868e385e38e5655f83bd32 (patch) | |
| tree | bf52ce9f90ad2d2fb0c2a30f623e0b808c73d791 | |
| parent | 24127a4ac4a4beabe89815b2d3ecd04311f96634 (diff) | |
esp8266: Make port-specific modules use MP_REGISTER_MODULE.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
| -rw-r--r-- | ports/esp8266/modesp.c | 2 | ||||
| -rw-r--r-- | ports/esp8266/modutime.c | 2 | ||||
| -rw-r--r-- | ports/esp8266/mpconfigport.h | 8 |
3 files changed, 4 insertions, 8 deletions
diff --git a/ports/esp8266/modesp.c b/ports/esp8266/modesp.c index 0e2acaf5f..a6084e48b 100644 --- a/ports/esp8266/modesp.c +++ b/ports/esp8266/modesp.c @@ -379,3 +379,5 @@ const mp_obj_module_t esp_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&esp_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_esp, esp_module, 1); diff --git a/ports/esp8266/modutime.c b/ports/esp8266/modutime.c index 1d4ecc05f..7f498ef1e 100644 --- a/ports/esp8266/modutime.c +++ b/ports/esp8266/modutime.c @@ -129,3 +129,5 @@ const mp_obj_module_t utime_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&time_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_utime, utime_module, 1); diff --git a/ports/esp8266/mpconfigport.h b/ports/esp8266/mpconfigport.h index 63577e7b0..a64bc8f86 100644 --- a/ports/esp8266/mpconfigport.h +++ b/ports/esp8266/mpconfigport.h @@ -159,14 +159,6 @@ extern const struct _mp_print_t mp_debug_print; #define MICROPY_PORT_BUILTINS \ { MP_ROM_QSTR(MP_QSTR_open), MP_ROM_PTR(&mp_builtin_open_obj) }, -// extra built in modules to add to the list of known ones -extern const struct _mp_obj_module_t esp_module; -extern const struct _mp_obj_module_t utime_module; - -#define MICROPY_PORT_BUILTIN_MODULES \ - { MP_ROM_QSTR(MP_QSTR_esp), MP_ROM_PTR(&esp_module) }, \ - { MP_ROM_QSTR(MP_QSTR_utime), MP_ROM_PTR(&utime_module) }, \ - #define MP_STATE_PORT MP_STATE_VM #define MICROPY_PORT_ROOT_POINTERS \ |
