esp32: 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:21:05 +10:00
parent 0a92469c10
commit 24127a4ac4
4 changed files with 6 additions and 10 deletions

View File

@ -142,3 +142,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);

View File

@ -224,3 +224,5 @@ const mp_obj_module_t esp32_module = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&esp32_module_globals,
};
MP_REGISTER_MODULE(MP_QSTR_esp32, esp32_module, 1);

View File

@ -106,3 +106,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);

View File

@ -136,16 +136,6 @@
{ MP_OBJ_NEW_QSTR(MP_QSTR_input), (mp_obj_t)&mp_builtin_input_obj }, \
{ MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&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 esp32_module;
extern const struct _mp_obj_module_t utime_module;
#define MICROPY_PORT_BUILTIN_MODULES \
{ MP_OBJ_NEW_QSTR(MP_QSTR_esp), (mp_obj_t)&esp_module }, \
{ MP_OBJ_NEW_QSTR(MP_QSTR_esp32), (mp_obj_t)&esp32_module }, \
{ MP_OBJ_NEW_QSTR(MP_QSTR_utime), (mp_obj_t)&utime_module }, \
#define MP_STATE_PORT MP_STATE_VM
struct _machine_timer_obj_t;