Skip to content

Commit 8ce2266

Browse files
committed
esp8266/modmachine: Call ets_event_poll after waiti in machine.idle.
Because "waiti 0" may have waited for a while (eg 500ms) and the internal WDT may need to be fed immediately. Fixes issue micropython#4459.
1 parent 9b2a97a commit 8ce2266

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ports/esp8266/modmachine.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ STATIC mp_obj_t machine_idle(void) {
9292
uint32_t t = mp_hal_ticks_cpu();
9393
asm("waiti 0");
9494
t = mp_hal_ticks_cpu() - t;
95+
ets_event_poll(); // handle any events after possibly a long wait (eg feed WDT)
9596
return MP_OBJ_NEW_SMALL_INT(t);
9697
}
9798
STATIC MP_DEFINE_CONST_FUN_OBJ_0(machine_idle_obj, machine_idle);

0 commit comments

Comments
 (0)