|
37 | 37 | #include "objlist.h" |
38 | 38 | #include "pybioctl.h" |
39 | 39 |
|
40 | | -/// \moduleref select |
| 40 | +/// \module select - Provides select function to wait for events on a stream |
| 41 | +/// |
| 42 | +/// This module provides the select function. |
41 | 43 |
|
42 | 44 | typedef struct _poll_obj_t { |
43 | 45 | mp_obj_t obj; |
@@ -278,3 +280,26 @@ STATIC mp_obj_t select_poll(void) { |
278 | 280 | return poll; |
279 | 281 | } |
280 | 282 | MP_DEFINE_CONST_FUN_OBJ_0(mp_select_poll_obj, select_poll); |
| 283 | + |
| 284 | +STATIC const mp_map_elem_t mp_module_select_globals_table[] = { |
| 285 | + { MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_select) }, |
| 286 | + { MP_OBJ_NEW_QSTR(MP_QSTR_select), (mp_obj_t)&mp_select_select_obj }, |
| 287 | + { MP_OBJ_NEW_QSTR(MP_QSTR_poll), (mp_obj_t)&mp_select_poll_obj }, |
| 288 | +}; |
| 289 | + |
| 290 | +STATIC const mp_obj_dict_t mp_module_select_globals = { |
| 291 | + .base = {&mp_type_dict}, |
| 292 | + .map = { |
| 293 | + .all_keys_are_qstrs = 1, |
| 294 | + .table_is_fixed_array = 1, |
| 295 | + .used = MP_ARRAY_SIZE(mp_module_select_globals_table), |
| 296 | + .alloc = MP_ARRAY_SIZE(mp_module_select_globals_table), |
| 297 | + .table = (mp_map_elem_t*)mp_module_select_globals_table, |
| 298 | + }, |
| 299 | +}; |
| 300 | + |
| 301 | +const mp_obj_module_t mp_module_select = { |
| 302 | + .base = { &mp_type_module }, |
| 303 | + .name = MP_QSTR_select, |
| 304 | + .globals = (mp_obj_dict_t*)&mp_module_select_globals, |
| 305 | +}; |
0 commit comments