File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424 * THE SOFTWARE.
2525 */
2626
27+ #include "py/mpconfig.h"
28+ #if MICROPY_PY_USELECT
29+
2730#include <stdio.h>
2831
2932#include "py/runtime.h"
@@ -309,3 +312,5 @@ const mp_obj_module_t mp_module_uselect = {
309312 .base = { & mp_type_module },
310313 .globals = (mp_obj_dict_t * )& mp_module_select_globals ,
311314};
315+
316+ #endif // MICROPY_PY_WEBSOCKET
Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ extern const mp_obj_module_t mp_module_uheapq;
108108extern const mp_obj_module_t mp_module_uhashlib ;
109109extern const mp_obj_module_t mp_module_ubinascii ;
110110extern const mp_obj_module_t mp_module_urandom ;
111+ extern const mp_obj_module_t mp_module_uselect ;
111112extern const mp_obj_module_t mp_module_ussl ;
112113extern const mp_obj_module_t mp_module_machine ;
113114extern const mp_obj_module_t mp_module_lwip ;
Original file line number Diff line number Diff line change @@ -873,6 +873,11 @@ typedef double mp_float_t;
873873#define MICROPY_PY_UERRNO (0)
874874#endif
875875
876+ // Whether to provide "uselect" module (baremetal implementation)
877+ #ifndef MICROPY_PY_USELECT
878+ #define MICROPY_PY_USELECT (0)
879+ #endif
880+
876881// Whether to provide "utime" module functions implementation
877882// in terms of mp_hal_* functions.
878883#ifndef MICROPY_PY_UTIME_MP_HAL
Original file line number Diff line number Diff line change @@ -198,6 +198,9 @@ STATIC const mp_rom_map_elem_t mp_builtin_module_table[] = {
198198#if MICROPY_PY_URANDOM
199199 { MP_ROM_QSTR (MP_QSTR_urandom ), MP_ROM_PTR (& mp_module_urandom ) },
200200#endif
201+ #if MICROPY_PY_USELECT
202+ { MP_ROM_QSTR (MP_QSTR_uselect ), MP_ROM_PTR (& mp_module_uselect ) },
203+ #endif
201204#if MICROPY_PY_USSL
202205 { MP_ROM_QSTR (MP_QSTR_ussl ), MP_ROM_PTR (& mp_module_ussl ) },
203206#endif
Original file line number Diff line number Diff line change @@ -219,6 +219,7 @@ PY_O_BASENAME = \
219219 ../extmod/modussl_axtls.o \
220220 ../extmod/modussl_mbedtls.o \
221221 ../extmod/modurandom.o \
222+ ../extmod/moduselect.o \
222223 ../extmod/modwebsocket.o \
223224 ../extmod/modwebrepl.o \
224225 ../extmod/modframebuf.o \
Original file line number Diff line number Diff line change @@ -150,7 +150,6 @@ SRC_C = \
150150 modstm.c \
151151 moduos.c \
152152 modutime.c \
153- moduselect.c \
154153 modusocket.c \
155154 modnetwork.c \
156155 import.c \
Original file line number Diff line number Diff line change 9292#define MICROPY_PY_UBINASCII (1)
9393#define MICROPY_PY_URANDOM (1)
9494#define MICROPY_PY_URANDOM_EXTRA_FUNCS (1)
95+ #define MICROPY_PY_USELECT (1)
9596#define MICROPY_PY_UCTYPES (1)
9697#define MICROPY_PY_UZLIB (1)
9798#define MICROPY_PY_UJSON (1)
@@ -135,7 +136,6 @@ extern const struct _mp_obj_module_t mp_module_uheapq;
135136extern const struct _mp_obj_module_t mp_module_uhashlib ;
136137extern const struct _mp_obj_module_t mp_module_uos ;
137138extern const struct _mp_obj_module_t mp_module_utime ;
138- extern const struct _mp_obj_module_t mp_module_uselect ;
139139extern const struct _mp_obj_module_t mp_module_usocket ;
140140extern const struct _mp_obj_module_t mp_module_network ;
141141
@@ -159,7 +159,6 @@ extern const struct _mp_obj_module_t mp_module_network;
159159 { MP_OBJ_NEW_QSTR(MP_QSTR_stm), (mp_obj_t)&stm_module }, \
160160 { MP_OBJ_NEW_QSTR(MP_QSTR_uos), (mp_obj_t)&mp_module_uos }, \
161161 { MP_OBJ_NEW_QSTR(MP_QSTR_utime), (mp_obj_t)&mp_module_utime }, \
162- { MP_OBJ_NEW_QSTR(MP_QSTR_uselect), (mp_obj_t)&mp_module_uselect }, \
163162 SOCKET_BUILTIN_MODULE \
164163 NETWORK_BUILTIN_MODULE \
165164
Original file line number Diff line number Diff line change @@ -28,7 +28,6 @@ extern const mp_obj_module_t pyb_module;
2828extern const mp_obj_module_t stm_module ;
2929extern const mp_obj_module_t mp_module_uos ;
3030extern const mp_obj_module_t mp_module_utime ;
31- extern const mp_obj_module_t mp_module_uselect ;
3231extern const mp_obj_module_t mp_module_usocket ;
3332
3433// additional helper functions exported by the modules
You can’t perform that action at this time.
0 commit comments