10000 Fix optimistic_yield to not yield on each call after x µs by dok-net · Pull Request #6804 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content

Fix optimistic_yield to not yield on each call after x µs #6804

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Feb 20, 2020
Prev Previous commit
Next Next commit
Move yield start time set to esp_yield_within_cont
  • Loading branch information
dok-net committed Feb 5, 2020
commit 3d7423bddea68eb78d49edb2389d8cf1286d6dd5
3 changes: 1 addition & 2 deletions cores/esp8266/core_esp8266_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand All @@ -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();
Expand All @@ -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)
Expand Down
0