@@ -150,7 +150,7 @@ STATIC mp_obj_t select_select(size_t n_args, const mp_obj_t *args) {
150150 mp_map_deinit (& poll_map );
151151 return mp_obj_new_tuple (3 , list_array );
152152 }
153- MICROPY_EVENT_POLL_HOOK
153+ RUN_BACKGROUND_TASKS ;
154154 }
155155}
156156MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (mp_select_select_obj , 3 , 4 , select_select );
@@ -229,7 +229,7 @@ STATIC mp_uint_t poll_poll_internal(uint n_args, const mp_obj_t *args) {
229229 if (n_ready > 0 || (timeout != (mp_uint_t )- 1 && mp_hal_ticks_ms () - start_tick >= timeout )) {
230230 break ;
231231 }
232- MICROPY_EVENT_POLL_HOOK
232+ RUN_BACKGROUND_TASKS ;
233233 }
234234
235235 return n_ready ;
@@ -318,10 +318,13 @@ STATIC MP_DEFINE_CONST_DICT(poll_locals_dict, poll_locals_dict_table);
318318
319319STATIC const mp_obj_type_t mp_type_poll = {
320320 { & mp_type_type },
321+ .flags = MP_TYPE_FLAG_EXTENDED ,
321322 .name = MP_QSTR_poll ,
322- .getiter = mp_identity_getiter ,
323- .iternext = poll_iternext ,
324323 .locals_dict = (void * )& poll_locals_dict ,
324+ MP_TYPE_EXTENDED_FIELDS (
325+ .getiter = mp_identity_getiter ,
326+ .iternext = poll_iternext ,
327+ ),
325328};
326329
327330// poll()
@@ -354,4 +357,6 @@ const mp_obj_module_t mp_module_uselect = {
354357 .globals = (mp_obj_dict_t * )& mp_module_select_globals ,
355358};
356359
360+ MP_REGISTER_MODULE (MP_QSTR_select , mp_module_uselect , MICROPY_PY_USELECT );
361+
357362#endif // MICROPY_PY_USELECT
0 commit comments