Skip to content

Commit bcb4088

Browse files
committed
update: recurrent function cannot schedule another recurrent function per esp8266#6235 example
1 parent 6237fd6 commit bcb4088

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

cores/esp8266/Schedule.cpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,9 @@ bool schedule_recurrent_function_us (const std::function<bool(void)>& fn, uint32
9898
item->mFunc = fn;
9999

100100
if (rFirst)
101-
{
102101
item->mNext = rFirst;
103-
rFirst = item;
104-
}
105-
else
106-
rFirst = item;
102+
103+
rFirst = item;
107104

108105
return true;
109106
}

cores/esp8266/Schedule.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ void run_scheduled_functions();
5858
// functions. However a user function returning false will cancel itself.
5959
// * Long running operations or yield() or delay() are not allowed in the
6060
// recurrent function.
61-
// * A recurrent scheduled function can schedule recurrent functions (if ever needed).
61+
// * A recurrent function currently must not schedule another recurrent
62+
// functions.
6263

6364
bool schedule_recurrent_function_us (const std::function<bool(void)>& fn, uint32_t repeat_us);
6465

0 commit comments

Comments
 (0)