8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 958c6d9 commit dff2938Copy full SHA for dff2938
extmod/machine_i2c.c
@@ -328,7 +328,12 @@ STATIC mp_obj_t machine_i2c_scan(mp_obj_t self_in) {
328
if (ret == 0) {
329
mp_obj_list_append(list, MP_OBJ_NEW_SMALL_INT(addr));
330
}
331
- #ifdef MICROPY_EVENT_POLL_HOOK
+ // This scan loop may run for some time, so process any pending events/exceptions,
332
+ // or allow the port to run any necessary background tasks. But do it as fast as
333
+ // possible, in particular we are not waiting on any events.
334
+ #if defined(MICROPY_EVENT_POLL_HOOK_FAST)
335
+ MICROPY_EVENT_POLL_HOOK_FAST;
336
+ #elif defined(MICROPY_EVENT_POLL_HOOK)
337
MICROPY_EVENT_POLL_HOOK
338
#endif
339
0 commit comments