diff options
Diffstat (limited to 'py')
-rw-r--r-- | py/builtin.h | 1 | ||||
-rw-r--r-- | py/builtintables.c | 3 | ||||
-rw-r--r-- | py/obj.h | 2 | ||||
-rw-r--r-- | py/py.mk | 1 | ||||
-rw-r--r-- | py/qstrdefs.h | 8 |
5 files changed, 14 insertions, 1 deletions
diff --git a/py/builtin.h b/py/builtin.h index 1bb61f6ebc..2ccd4481a2 100644 --- a/py/builtin.h +++ b/py/builtin.h @@ -89,3 +89,4 @@ extern struct _dummy_t mp_sys_stderr_obj; // extmod modules extern const mp_obj_module_t mp_module_uctypes; extern const mp_obj_module_t mp_module_zlibd; +extern const mp_obj_module_t mp_module_select; diff --git a/py/builtintables.c b/py/builtintables.c index 08b6b16493..ad2e0bb55f 100644 --- a/py/builtintables.c +++ b/py/builtintables.c @@ -200,6 +200,9 @@ STATIC const mp_map_elem_t mp_builtin_module_table[] = { #if MICROPY_PY_ZLIBD { MP_OBJ_NEW_QSTR(MP_QSTR_zlibd), (mp_obj_t)&mp_module_zlibd }, #endif +#if MICROPY_PY_SELECT + { MP_OBJ_NEW_QSTR(MP_QSTR_select), (mp_obj_t)&mp_module_select }, +#endif // extra builtin modules as defined by a port MICROPY_PORT_BUILTIN_MODULES @@ -237,7 +237,7 @@ typedef struct _mp_stream_p_t { // are implementation-dependent, but will be exposed to user, e.g. via exception). mp_uint_t (*read)(mp_obj_t obj, void *buf, mp_uint_t size, int *errcode); mp_uint_t (*write)(mp_obj_t obj, const void *buf, mp_uint_t size, int *errcode); - mp_uint_t (*ioctl(mp_obj_t obj, mp_uint_t request, int *errcode, ...); + mp_uint_t (*ioctl)(mp_obj_t obj, mp_uint_t request, int *errcode, ...); mp_uint_t is_text : 1; // default is bytes, set this for text stream } mp_stream_p_t; @@ -112,6 +112,7 @@ PY_O_BASENAME = \ pfenv_printf.o \ ../extmod/moductypes.o \ ../extmod/modzlibd.o \ + ../extmod/modselect.o \ # prepend the build destination prefix to the py object files PY_O = $(addprefix $(PY_BUILD)/, $(PY_O_BASENAME)) diff --git a/py/qstrdefs.h b/py/qstrdefs.h index d41029a1fa..68681e47be 100644 --- a/py/qstrdefs.h +++ b/py/qstrdefs.h @@ -463,3 +463,11 @@ Q(deleter) Q(zlibd) Q(decompress) #endif + +#if MICROPY_PY_SELECT +Q(select) +Q(poll) +Q(register) +Q(unregister) +Q(modify) +#endif |