From 3d7423bddea68eb78d49edb2389d8cf1286d6dd5 Mon Sep 17 00:00:00 2001 From: "Dirk O. Kaar" Date: Tue, 19 Nov 2019 13:49:19 +0100 Subject: [PATCH] Move yield start time set to esp_yield_within_cont --- cores/esp8266/core_esp8266_main.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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)