diff --git a/cores/esp8266/core_esp8266_main.cpp b/cores/esp8266/core_esp8266_main.cpp index 70f4215d7..aca69a216 100644 --- a/cores/esp8266/core_esp8266_main.cpp +++ b/cores/esp8266/core_esp8266_main.cpp @@ -97,6 +97,7 @@ extern "C" bool can_yield() { static inline void esp_yield_within_cont() __attribute__((always_inline)); static void esp_yield_within_cont() { cont_yield(g_pcont); + s_cycles_since_yield_start = ESP.getCycleCount(); run_scheduled_recurrent_functions(); } @@ -116,7 +117,6 @@ extern "C" void __yield() { if (can_yield()) { esp_schedule(); esp_yield_within_cont(); - s_cycles_since_yield_start = ESP.getCycleCount(); } else { panic(); @@ -134,7 +134,6 @@ extern "C" void optimistic_yield(uint32_t interval_us) { } } - // Replace ets_intr_(un)lock with nestable versions extern "C" void IRAM_ATTR ets_intr_lock() { if (ets_intr_lock_stack_ptr < ETS_INTR_LOCK_NEST_MAX)