We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1674c72 commit 4f09a64Copy full SHA for 4f09a64
cores/esp8266/Schedule.cpp
@@ -46,8 +46,12 @@ bool schedule_function_us(mFuncT fn, uint32_t repeat_us)
46
return false;
47
}
48
item->mFunc = fn;
49
+
50
+ noInterrupts();
51
item->mNext = sFirst;
52
sFirst = item;
53
+ interrupts();
54
55
if (repeat_us)
56
item->callNow.reset(repeat_us);
57
return true;
@@ -64,9 +68,13 @@ void run_scheduled_functions()
64
68
while (toCall) {
65
69
scheduled_fn_t* item = toCall;
66
70
toCall = item->mNext;
67
- if (item->callNow && !item->mFunc()) {
71
+ if (item->callNow && !item->mFunc())
72
+ {
73
74
if (sFirst == item)
75
sFirst = item->mNext;
76
77
78
item->mFunc = mFuncT();
79
recycle_fn(item);
80
0 commit comments