File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -135,8 +135,6 @@ bool schedule_recurrent_function_us(const std::function<bool(void)>& fn,
135
135
136
136
void run_scheduled_functions ()
137
137
{
138
- esp8266::polledTimeout::periodicFastMs yieldNow (100 ); // yield every 100ms
139
-
140
138
// prevent scheduling of new functions during this run
141
139
auto stop = sLast ;
142
140
bool done = false ;
@@ -161,14 +159,10 @@ void run_scheduled_functions()
161
159
recycle_fn_unsafe (to_recycle);
162
160
}
163
161
164
- if (yieldNow)
165
- {
166
- // because scheduled functions might last too long for watchdog etc,
167
- // this is yield() in cont stack, but need to call cont_suspend directly
168
- // to prevent recursion into run_scheduled_recurrent_functions()
169
- esp_schedule ();
170
- cont_suspend (g_pcont);
171
- }
162
+ // scheduled functions might last too long for watchdog etc.
163
+ // yield() is allowed in scheduled functions, therefore
164
+ // recursion into run_scheduled_recurrent_functions() is permitted
165
+ optimistic_yield (100000 );
172
166
}
173
167
}
174
168
You can’t perform that action at this time.
0 commit comments