mirror of
https://github.com/micropython/micropython.git
synced 2026-01-07 04:30:24 +01:00
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>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user