From a4ae8564f7efc51f93521f3088eb025c34e69f09 Mon Sep 17 00:00:00 2001 From: david gauchard Date: Mon, 27 May 2019 09:13:38 +0200 Subject: [PATCH] schedule: fix linked-list (per @dok-net review) (#6147) --- cores/esp8266/Schedule.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cores/esp8266/Schedule.cpp b/cores/esp8266/Schedule.cpp index 29fbf7cde..4e6a0780e 100644 --- a/cores/esp8266/Schedule.cpp +++ b/cores/esp8266/Schedule.cpp @@ -120,10 +120,12 @@ void run_scheduled_functions() { if (toCall->mFunc()) { + // function stays in list lastRecurring = toCall; } else { + // function removed from list InterruptLock lockAllInterruptsInThisScope; if (sFirst == toCall) @@ -137,6 +139,9 @@ void run_scheduled_functions() recycle_fn_unsafe(toCall); } } + else + // function stays in list + lastRecurring = toCall; } fence = false;