-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
yield(), esp_yield() or delay(0) ? #1950
Comments
I already used The main different is that esp_yield will test if it is being run from cont stack or system stack. Not sure what the |
esp_yield(): ESP8266Ping only |
There are not that many places anymore where we are calling delay with 1, are there? |
in the Arduino core, they change a yield() for esp_yield() and the webserver got unresponsive. So, a delay(0) was the solution there to avoid the issue. |
@TD-er 110 places only in ESPEasy, did not count in libraries |
OK, good to know. Edit: |
@ascillato |
`delay(0)` is a special case of delay, which also calls the system scheduler, `yield()` does not call. It may interrupt a bit more than `yield()` See letscontrolit#1950
@TD-er I really don't know. Sorry. May be we need to ask that to Arduino Guys. |
Maybe @d-a-v or @earlephilhower can shed some light on the difference between |
Maybe an issue should be opened in the core repository, with the very same title. |
I will close this, open if its still a valid issue. |
was this different years ago? delay(0) won't call yield at all, delay(1) would though |
As far as I can remember, there was indeed a difference between |
@TD-er just found this: esp8266/Arduino#5254
Apparently there is a difference between the three. And using the wrong one has the potential to crash the system. Were you aware of this ?
I still need to dig deeper.
If you know something about this, please enlighten me.
The text was updated successfully, but these errors were encountered: