Thanks to visit codestin.com
Credit goes to github.com

Skip to content

top: Replace MICROPY_PORT_BUILTIN_MODULES with MP_REGISTER_MODULE. #8566

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
May 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
4694501
py/makemoduledefs.py: Allow multiple ways to register a module.
jimmo Apr 20, 2022
4eab44a
extmod: Make extmod modules use MP_REGISTER_MODULE.
jimmo Apr 20, 2022
d8d3e6a
py: Make builtin modules use MP_REGISTER_MODULE.
jimmo Apr 20, 2022
bb794f0
extmod: Make port-included extmod modules use MP_REGISTER_MODULES.
jimmo Apr 20, 2022
0a92469
stm32: Make port-specific modules use MP_REGISTER_MODULE.
jimmo Apr 20, 2022
24127a4
esp32: Make port-specific modules use MP_REGISTER_MODULE.
jimmo Apr 20, 2022
4274b34
esp8266: Make port-specific modules use MP_REGISTER_MODULE.
jimmo Apr 20, 2022
7d79fd7
mimxrt: Make port-specific modules use MP_REGISTER_MODULE.
jimmo Apr 20, 2022
f67ac90
nrf: Make port-specific modules use MP_REGISTER_MODULE.
jimmo Apr 20, 2022
60c5968
pic16bit: Make port-specific modules use MP_REGISTER_MODULE.
jimmo Apr 20, 2022
62f00a4
rp2: Make port-specific modules use MP_REGISTER_MODULE.
jimmo Apr 20, 2022
c3f7424
samd: Make port-specific modules use MP_REGISTER_MODULE.
jimmo Apr 20, 2022
d0307e7
teensy: Make port-specific modules use MP_REGISTER_MODULE.
jimmo Apr 20, 2022
63431a5
unix: Make port-specific modules use MP_REGISTER_MODULE.
jimmo Apr 20, 2022
ec2fe5d
zephyr: Make port-specific modules use MP_REGISTER_MODULE.
jimmo Apr 20, 2022
9e4da23
javascript: Make port-specific modules use MP_REGISTER_MODULE.
jimmo Apr 20, 2022
1d33ceb
cc3200: Make port-specific modules use MP_REGISTER_MODULE.
jimmo Apr 20, 2022
c2d889f
renesas-ra: Make port-specific modules use MP_REGISTER_MODULE.
jimmo May 13, 2022
8b201dc
py: Remove support for MICROPY_PORT_BUILTIN_MODULES.
jimmo Apr 20, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions extmod/modbluetooth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1004,6 +1004,8 @@ const mp_obj_module_t mp_module_ubluetooth = {
.globals = (mp_obj_dict_t *)&mp_module_bluetooth_globals,
};

MP_REGISTER_MODULE(MP_QSTR_ubluetooth, mp_module_ubluetooth, MICROPY_PY_BLUETOOTH);

// Helpers

#if !MICROPY_PY_BLUETOOTH_USE_SYNC_EVENTS
Expand Down
2 changes: 2 additions & 0 deletions extmod/modbtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,8 @@ const mp_obj_module_t mp_module_btree = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&mp_module_btree_globals,
};

MP_REGISTER_MODULE(MP_QSTR_btree, mp_module_btree, MICROPY_PY_BTREE);
#endif

#endif // MICROPY_PY_BTREE
2 changes: 2 additions & 0 deletions extmod/modframebuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,8 @@ const mp_obj_module_t mp_module_framebuf = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&framebuf_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_framebuf, mp_module_framebuf, MICROPY_PY_FRAMEBUF);
#endif

#endif // MICROPY_PY_FRAMEBUF
5 changes: 5 additions & 0 deletions extmod/modlwip.c
Original file line number Diff line number Diff line change
Expand Up @@ -1778,4 +1778,9 @@ const mp_obj_module_t mp_module_lwip = {
.globals = (mp_obj_dict_t *)&mp_module_lwip_globals,
};

MP_REGISTER_MODULE(MP_QSTR_lwip, mp_module_lwip, MICROPY_PY_LWIP);

// On LWIP-ports, this is the usocket module (replaces extmod/modusocket.c).
MP_REGISTER_MODULE(MP_QSTR_socket, mp_module_lwip, MICROPY_PY_LWIP);

#endif // MICROPY_PY_LWIP
2 changes: 2 additions & 0 deletions extmod/modnetwork.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ const mp_obj_module_t mp_module_network = {
.globals = (mp_obj_dict_t *)&mp_module_network_globals,
};

MP_REGISTER_MODULE(MP_QSTR_network, mp_module_network, MICROPY_PY_NETWORK);

/*******************************************************************************/
// Implementations of network methods that can be used by any interface

Expand Down
2 changes: 2 additions & 0 deletions extmod/modonewire.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,6 @@ const mp_obj_module_t mp_module_onewire = {
.globals = (mp_obj_dict_t *)&onewire_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR__onewire, mp_module_onewire, MICROPY_PY_ONEWIRE);

#endif // MICROPY_PY_ONEWIRE
2 changes: 2 additions & 0 deletions extmod/moduasyncio.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,4 +310,6 @@ const mp_obj_module_t mp_module_uasyncio = {
.globals = (mp_obj_dict_t *)&mp_module_uasyncio_globals,
};

MP_REGISTER_MODULE(MP_QSTR__uasyncio, mp_module_uasyncio, MICROPY_PY_UASYNCIO);

#endif // MICROPY_PY_UASYNCIO
2 changes: 2 additions & 0 deletions extmod/modubinascii.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,4 +258,6 @@ const mp_obj_module_t mp_module_ubinascii = {
.globals = (mp_obj_dict_t *)&mp_module_binascii_globals,
};

MP_REGISTER_MODULE(MP_QSTR_ubinascii, mp_module_ubinascii, MICROPY_PY_UBINASCII);

#endif // MICROPY_PY_UBINASCII
2 changes: 2 additions & 0 deletions extmod/moducryptolib.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,4 +374,6 @@ const mp_obj_module_t mp_module_ucryptolib = {
.globals = (mp_obj_dict_t *)&mp_module_ucryptolib_globals,
};

MP_REGISTER_MODULE(MP_QSTR_ucryptolib, mp_module_ucryptolib, MICROPY_PY_UCRYPTOLIB);

#endif // MICROPY_PY_UCRYPTOLIB
2 changes: 2 additions & 0 deletions extmod/moductypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,4 +717,6 @@ const mp_obj_module_t mp_module_uctypes = {
.globals = (mp_obj_dict_t *)&mp_module_uctypes_globals,
};

MP_REGISTER_MODULE(MP_QSTR_uctypes, mp_module_uctypes, MICROPY_PY_UCTYPES);

#endif
2 changes: 2 additions & 0 deletions extmod/moduhashlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,4 +371,6 @@ const mp_obj_module_t mp_module_uhashlib = {
.globals = (mp_obj_dict_t *)&mp_module_uhashlib_globals,
};

MP_REGISTER_MODULE(MP_QSTR_uhashlib, mp_module_uhashlib, MICROPY_PY_UHASHLIB);

#endif // MICROPY_PY_UHASHLIB
2 changes: 2 additions & 0 deletions extmod/moduheapq.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ const mp_obj_module_t mp_module_uheapq = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&mp_module_uheapq_globals,
};

MP_REGISTER_MODULE(MP_QSTR_uheapq, mp_module_uheapq, MICROPY_PY_UHEAPQ);
#endif

#endif // MICROPY_PY_UHEAPQ
2 changes: 2 additions & 0 deletions extmod/modujson.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,4 +381,6 @@ const mp_obj_module_t mp_module_ujson = {
.globals = (mp_obj_dict_t *)&mp_module_ujson_globals,
};

MP_REGISTER_MODULE(MP_QSTR_ujson, mp_module_ujson, MICROPY_PY_UJSON);

#endif // MICROPY_PY_UJSON
2 changes: 2 additions & 0 deletions extmod/moduos.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,6 @@ const mp_obj_module_t mp_module_uos = {
.globals = (mp_obj_dict_t *)&os_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_uos, mp_module_uos, MICROPY_PY_UOS);

#endif // MICROPY_PY_UOS
2 changes: 2 additions & 0 deletions extmod/moduplatform.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,6 @@ const mp_obj_module_t mp_module_uplatform = {
.globals = (mp_obj_dict_t *)&modplatform_globals,
};

MP_REGISTER_MODULE(MP_QSTR_uplatform, mp_module_uplatform, MICROPY_PY_UPLATFORM);

#endif // MICROPY_PY_UPLATFORM
2 changes: 2 additions & 0 deletions extmod/modurandom.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ const mp_obj_module_t mp_module_urandom = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&mp_module_urandom_globals,
};

MP_REGISTER_MODULE(MP_QSTR_urandom, mp_module_urandom, MICROPY_PY_URANDOM);
#endif

#endif // MICROPY_PY_URANDOM
2 changes: 2 additions & 0 deletions extmod/modure.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,8 @@ const mp_obj_module_t mp_module_ure = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&mp_module_re_globals,
};

MP_REGISTER_MODULE(MP_QSTR_ure, mp_module_ure, MICROPY_PY_URE);
#endif

// Source files #include'd here to make sure they're compiled in
Expand Down
2 changes: 2 additions & 0 deletions extmod/moduselect.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,4 +373,6 @@ const mp_obj_module_t mp_module_uselect = {
.globals = (mp_obj_dict_t *)&mp_module_select_globals,
};

MP_REGISTER_MODULE(MP_QSTR_uselect, mp_module_uselect, MICROPY_PY_USELECT);

#endif // MICROPY_PY_USELECT
2 changes: 2 additions & 0 deletions extmod/modusocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,4 +588,6 @@ const mp_obj_module_t mp_module_usocket = {
.globals = (mp_obj_dict_t *)&mp_module_usocket_globals,
};

MP_REGISTER_MODULE(MP_QSTR_socket, mp_module_usocket, MICROPY_PY_NETWORK && MICROPY_PY_USOCKET && !MICROPY_PY_LWIP);

#endif // MICROPY_PY_NETWORK && MICROPY_PY_USOCKET && !MICROPY_PY_LWIP
4 changes: 3 additions & 1 deletion extmod/modussl_axtls.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,4 +358,6 @@ const mp_obj_module_t mp_module_ussl = {
.globals = (mp_obj_dict_t *)&mp_module_ssl_globals,
};

#endif // MICROPY_PY_USSL
MP_REGISTER_MODULE(MP_QSTR_ussl, mp_module_ussl, MICROPY_PY_USSL && MICROPY_SSL_AXTLS);

#endif // MICROPY_PY_USSL && MICROPY_SSL_AXTLS
4 changes: 3 additions & 1 deletion extmod/modussl_mbedtls.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,4 +418,6 @@ const mp_obj_module_t mp_module_ussl = {
.globals = (mp_obj_dict_t *)&mp_module_ssl_globals,
};

#endif // MICROPY_PY_USSL
MP_REGISTER_MODULE(MP_QSTR_ussl, mp_module_ussl, MICROPY_PY_USSL && MICROPY_SSL_MBEDTLS);

#endif // MICROPY_PY_USSL && MICROPY_SSL_MBEDTLS
1 change: 1 addition & 0 deletions extmod/modutimeq.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,4 +229,5 @@ const mp_obj_module_t mp_module_utimeq = {
.globals = (mp_obj_dict_t *)&mp_module_utimeq_globals,
};

MP_REGISTER_MODULE(MP_QSTR_utimeq, mp_module_utimeq, MICROPY_PY_UTIMEQ);
#endif // MICROPY_PY_UTIMEQ
2 changes: 2 additions & 0 deletions extmod/moduwebsocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,4 +310,6 @@ const mp_obj_module_t mp_module_uwebsocket = {
.globals = (mp_obj_dict_t *)&uwebsocket_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_uwebsocket, mp_module_uwebsocket, MICROPY_PY_UWEBSOCKET);

#endif // MICROPY_PY_UWEBSOCKET
3 changes: 3 additions & 0 deletions extmod/moduzlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ const mp_obj_module_t mp_module_uzlib = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&mp_module_uzlib_globals,
};


MP_REGISTER_MODULE(MP_QSTR_uzlib, mp_module_uzlib, MICROPY_PY_UZLIB);
#endif

// Source files #include'd here to make sure they're compiled in
Expand Down
2 changes: 2 additions & 0 deletions extmod/modwebrepl.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,4 +363,6 @@ const mp_obj_module_t mp_module_webrepl = {
.globals = (mp_obj_dict_t *)&webrepl_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR__webrepl, mp_module_webrepl, MICROPY_PY_WEBREPL);

#endif // MICROPY_PY_WEBREPL
2 changes: 2 additions & 0 deletions ports/cc3200/mods/modmachine.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,3 +213,5 @@ const mp_obj_module_t mp_module_machine = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t*)&machine_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_umachine, mp_module_machine, MICROPY_PY_MACHINE);
2 changes: 2 additions & 0 deletions ports/cc3200/mods/modnetwork.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ const mp_obj_module_t mp_module_network = {
.globals = (mp_obj_dict_t*)&mp_module_network_globals,
};

MP_REGISTER_MODULE(MP_QSTR_network, mp_module_network, 1);

#if (MICROPY_PORT_HAS_TELNET || MICROPY_PORT_HAS_FTP)
STATIC const mp_rom_map_elem_t network_server_locals_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_init), MP_ROM_PTR(&network_server_init_obj) },
Expand Down
2 changes: 2 additions & 0 deletions ports/cc3200/mods/moduos.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,5 @@ const mp_obj_module_t mp_module_uos = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t*)&os_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_uos, mp_module_uos, 1);
2 changes: 2 additions & 0 deletions ports/cc3200/mods/modusocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -816,3 +816,5 @@ const mp_obj_module_t mp_module_usocket = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t*)&mp_module_usocket_globals,
};

MP_REGISTER_MODULE(MP_QSTR_usocket, mp_module_usocket, 1);
1 change: 1 addition & 0 deletions ports/cc3200/mods/modussl.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,4 @@ const mp_obj_module_t mp_module_ussl = {
.globals = (mp_obj_dict_t*)&mp_module_ussl_globals,
};

MP_REGISTER_MODULE(MP_QSTR_ussl, mp_module_ussl, 1);
2 changes: 2 additions & 0 deletions ports/cc3200/mods/modutime.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,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);
2 changes: 2 additions & 0 deletions ports/cc3200/mods/modwipy.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ const mp_obj_module_t wipy_module = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t*)&wipy_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_wipy, wipy_module, 1);
22 changes: 0 additions & 22 deletions ports/cc3200/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,28 +144,6 @@
#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 wipy_module;
extern const struct _mp_obj_module_t mp_module_ure;
extern const struct _mp_obj_module_t mp_module_ujson;
extern const struct _mp_obj_module_t mp_module_uos;
extern const struct _mp_obj_module_t mp_module_utime;
extern const struct _mp_obj_module_t mp_module_uselect;
extern const struct _mp_obj_module_t mp_module_usocket;
extern const struct _mp_obj_module_t mp_module_network;
extern const struct _mp_obj_module_t mp_module_ubinascii;
extern const struct _mp_obj_module_t mp_module_ussl;

#define MICROPY_PORT_BUILTIN_MODULES \
{ MP_ROM_QSTR(MP_QSTR_wipy), MP_ROM_PTR(&wipy_module) }, \
{ MP_ROM_QSTR(MP_QSTR_uos), MP_ROM_PTR(&mp_module_uos) }, \
{ MP_ROM_QSTR(MP_QSTR_utime), MP_ROM_PTR(&mp_module_utime) }, \
{ MP_ROM_QSTR(MP_QSTR_uselect), MP_ROM_PTR(&mp_module_uselect) }, \
{ MP_ROM_QSTR(MP_QSTR_usocket), MP_ROM_PTR(&mp_module_usocket) }, \
{ MP_ROM_QSTR(MP_QSTR_network), MP_ROM_PTR(&mp_module_network) }, \
{ MP_ROM_QSTR(MP_QSTR_ubinascii), MP_ROM_PTR(&mp_module_ubinascii) }, \
{ MP_ROM_QSTR(MP_QSTR_ussl), MP_ROM_PTR(&mp_module_ussl) }, \

// extra constants
#define MICROPY_PORT_CONSTANTS \
{ MP_ROM_QSTR(MP_QSTR_umachine), MP_ROM_PTR(&mp_module_machine) }, \
Expand Down
2 changes: 2 additions & 0 deletions ports/esp32/modesp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
2 changes: 2 additions & 0 deletions ports/esp32/modesp32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
2 changes: 2 additions & 0 deletions ports/esp32/modmachine.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,4 +337,6 @@ const mp_obj_module_t mp_module_machine = {
.globals = (mp_obj_dict_t *)&machine_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_umachine, mp_module_machine, MICROPY_PY_MACHINE);

#endif // MICROPY_PY_MACHINE
4 changes: 4 additions & 0 deletions ports/esp32/modnetwork.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,3 +295,7 @@ const mp_obj_module_t mp_module_network = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&mp_module_network_globals,
};

// Note: This port doesn't define MICROPY_PY_NETWORK so this will not conflict
// with the common implementation provided by extmod/modnetwork.c.
MP_REGISTER_MODULE(MP_QSTR_network, mp_module_network, 1);
5 changes: 5 additions & 0 deletions ports/esp32/modsocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -867,3 +867,8 @@ const mp_obj_module_t mp_module_usocket = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&mp_module_socket_globals,
};

// Note: This port doesn't define MICROPY_PY_USOCKET or MICROPY_PY_LWIP so
// this will not conflict with the common implementation provided by
// extmod/mod{lwip,usocket}.c.
MP_REGISTER_MODULE(MP_QSTR_usocket, mp_module_usocket, 1);
2 changes: 2 additions & 0 deletions ports/esp32/modutime.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
16 changes: 0 additions & 16 deletions ports/esp32/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,22 +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;
extern const struct _mp_obj_module_t mp_module_usocket;
extern const struct _mp_obj_module_t mp_module_network;
extern const struct _mp_obj_module_t mp_module_onewire;

#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 }, \
{ MP_OBJ_NEW_QSTR(MP_QSTR_usocket), (mp_obj_t)&mp_module_usocket }, \
{ MP_OBJ_NEW_QSTR(MP_QSTR_network), (mp_obj_t)&mp_module_network }, \
{ MP_OBJ_NEW_QSTR(MP_QSTR__onewire), (mp_obj_t)&mp_module_onewire }, \

#define MP_STATE_PORT MP_STATE_VM

struct _machine_timer_obj_t;
Expand Down
2 changes: 2 additions & 0 deletions ports/esp8266/modesp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
2 changes: 2 additions & 0 deletions ports/esp8266/modmachine.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,4 +453,6 @@ const mp_obj_module_t mp_module_machine = {
.globals = (mp_obj_dict_t *)&machine_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_umachine, mp_module_machine, MICROPY_PY_MACHINE);

#endif // MICROPY_PY_MACHINE
4 changes: 4 additions & 0 deletions ports/esp8266/modnetwork.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,3 +545,7 @@ const mp_obj_module_t network_module = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&mp_module_network_globals,
};

// Note: This port doesn't define MICROPY_PY_NETWORK so this will not conflict
// with the common implementation provided by extmod/modnetwork.c.
MP_REGISTER_MODULE(MP_QSTR_network, network_module, 1);
2 changes: 2 additions & 0 deletions ports/esp8266/modutime.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
14 changes: 0 additions & 14 deletions ports/esp8266/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,20 +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 network_module;
extern const struct _mp_obj_module_t utime_module;
extern const struct _mp_obj_module_t mp_module_lwip;
extern const struct _mp_obj_module_t mp_module_onewire;

#define MICROPY_PORT_BUILTIN_MODULES \
{ MP_ROM_QSTR(MP_QSTR_esp), MP_ROM_PTR(&esp_module) }, \
{ MP_ROM_QSTR(MP_QSTR_usocket), MP_ROM_PTR(&mp_module_lwip) }, \
{ MP_ROM_QSTR(MP_QSTR_network), MP_ROM_PTR(&network_module) }, \
{ MP_ROM_QSTR(MP_QSTR_utime), MP_ROM_PTR(&utime_module) }, \
{ MP_ROM_QSTR(MP_QSTR__onewire), MP_ROM_PTR(&mp_module_onewire) }, \

#define MP_STATE_PORT MP_STATE_VM

#define MICROPY_PORT_ROOT_POINTERS \
Expand Down
2 changes: 2 additions & 0 deletions ports/javascript/modutime.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,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);
5 changes: 0 additions & 5 deletions ports/javascript/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,6 @@

#define MP_SSIZE_MAX (0x7fffffff)

extern const struct _mp_obj_module_t mp_module_utime;

#define MICROPY_PORT_BUILTIN_MODULES \
{ MP_ROM_QSTR(MP_QSTR_utime), MP_ROM_PTR(&mp_module_utime) }, \

// #define MICROPY_EVENT_POLL_HOOK {ets_event_poll();}
#if MICROPY_PY_THREAD
#define MICROPY_EVENT_POLL_HOOK \
Expand Down
Loading