extmod/modlwip: Use MP_REGISTER_ROOT_POINTER().

This uses MP_REGISTER_ROOT_POINTER() to register lwip_slip_stream
instead of using a conditional inside of mp_state_vm_t.

Signed-off-by: David Lechner <david@pybricks.com>
pull/8922/head
David Lechner 2022-07-02 15:05:41 -05:00 zatwierdzone przez Damien George
rodzic 631b692177
commit d532c55e3b
2 zmienionych plików z 2 dodań i 4 usunięć

Wyświetl plik

@ -1783,4 +1783,6 @@ MP_REGISTER_MODULE(MP_QSTR_lwip, mp_module_lwip);
// On LWIP-ports, this is the usocket module (replaces extmod/modusocket.c).
MP_REGISTER_MODULE(MP_QSTR_usocket, mp_module_lwip);
MP_REGISTER_ROOT_POINTER(mp_obj_t lwip_slip_stream);
#endif // MICROPY_PY_LWIP

Wyświetl plik

@ -198,10 +198,6 @@ typedef struct _mp_state_vm_t {
// root pointers for extmod
#if MICROPY_PY_LWIP_SLIP
mp_obj_t lwip_slip_stream;
#endif
#if MICROPY_VFS
struct _mp_vfs_mount_t *vfs_cur;
struct _mp_vfs_mount_t *vfs_mount_table;