summaryrefslogtreecommitdiff
path: root/extmod
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2022-04-20 17:17:39 +1000
committerJim Mussared <jim.mussared@gmail.com>2022-05-18 20:49:12 +1000
commitbb794f05b7fef75696118ea1eb03a769a9fac40d (patch)
tree385c0cde24eefeee13ea5ae2efbf0fcf7d5e9713 /extmod
parentd8d3e6ae787718fffacde2eb22b7eb32fb759484 (diff)
extmod: Make port-included extmod modules use MP_REGISTER_MODULES.
_onewire, socket, and network were previously added by the port rather than objmodule.c. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'extmod')
-rw-r--r--extmod/modlwip.c3
-rw-r--r--extmod/modnetwork.c2
-rw-r--r--extmod/modonewire.c2
-rw-r--r--extmod/modusocket.c2
4 files changed, 9 insertions, 0 deletions
diff --git a/extmod/modlwip.c b/extmod/modlwip.c
index 53bead2a3..e20ade139 100644
--- a/extmod/modlwip.c
+++ b/extmod/modlwip.c
@@ -1780,4 +1780,7 @@ const mp_obj_module_t mp_module_lwip = {
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
diff --git a/extmod/modnetwork.c b/extmod/modnetwork.c
index 1f242de86..f63f708a2 100644
--- a/extmod/modnetwork.c
+++ b/extmod/modnetwork.c
@@ -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
diff --git a/extmod/modonewire.c b/extmod/modonewire.c
index 8b3426815..1cfddc830 100644
--- a/extmod/modonewire.c
+++ b/extmod/modonewire.c
@@ -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
diff --git a/extmod/modusocket.c b/extmod/modusocket.c
index bd11e70c1..c4bf6342a 100644
--- a/extmod/modusocket.c
+++ b/extmod/modusocket.c
@@ -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