Skip to content
Snippets Groups Projects
Commit 8ce22662 authored by Damien George's avatar Damien George
Browse files

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 #4459.
parent 9b2a97a9
No related branches found
No related tags found
No related merge requests found
......@@ -92,6 +92,7 @@ STATIC mp_obj_t machine_idle(void) {
uint32_t t = mp_hal_ticks_cpu();
asm("waiti 0");
t = mp_hal_ticks_cpu() - t;
ets_event_poll(); // handle any events after possibly a long wait (eg feed WDT)
return MP_OBJ_NEW_SMALL_INT(t);
}
STATIC MP_DEFINE_CONST_FUN_OBJ_0(machine_idle_obj, machine_idle);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment