-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Renamings for that esp_yield
is really suspend, replacing delay(0), shimmable suspend-CONT API for async esp_suspend() / esp_schedule()
#7148
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
4df7186
delay0isyield squash commit.
dok-net b64622d
_notifyPWM may be called indirectly from ISR, cannot yield() from ISR…
dok-net 9bb4894
Fix for 656a33e6f8
dok-net 97d59ae
Consolidate renaming of identifiers to clarify strict meaning of susp…
dok-net 08ed7d0
Non-recurring scheduled functions may yield, therefore run_scheduled_…
dok-net 397408f
Add HAVE_ESP_SUSPEND define to allow 3rd party libraries to detect AP…
dok-net 0bb470c
Merge branch 'esp_yield_mt' into delay0isyield
dok-net 971ad28
Make detectBaudrate safe from SYS context, for what it's worth.
dok-net 99ed6fc
Add comment about how optimistic_yield() is safe for SYS, like in cal…
dok-net cd8d2d3
Adapt logic to feed scheduled recurrent functions in hostByName from …
dok-net 070eb48
Add clarifying comments to esp_suspend and esp_delay overloads.
dok-net d11be8b
Refactoring as seen in PR #8317
dok-net 4b92d28
Removed redundant duplicate type definition.
dok-net 208c4a3
Use function template syntax to save using std::function objects.
dok-net 3720ac0
Fix uninitialized status for immediately expired timeout.
dok-net 3be70a4
Specification for try_esp_delay added as code comment.
dok-net 67ced12
Apply suggestions from code review
dok-net 62af940
By review feedback, maintain esp_ as prefix.
dok-net 863c482
Code cleanup as per review feedback.
dok-net 679ecb1
Enable the startWaveform functions for calling from SYS context. Remo…
dok-net 6199eb9
Adopt same code for host-test version of `esp_try_delay`.
dok-net 7cfaeea
Merge branch 'master' into delay0isyield
dok-net File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Apply suggestions from code review
Co-authored-by: Max Prokhorov <prokhorov.max@outlook.com>
- Loading branch information
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about commenting the choice of this name (is it interrupting tasks calling (
delay()
) from cont stack) and also that it is equivalent todelay(0)
?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If new function names are to be added, with restrictions on usage, like "use esp_break() if code is called from SYS", I suggest adding_from_sys
in its name to make it clear.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yield()
historically panics on purpose when it is called from SYS.esp_break()
is exactlyyield()
withoutpanic()
, callable from both cont and sys.Considering that the
yield()
'spanic()
is avoided bydelay(0)
or its new flavouresp_break()
, then we may just updateyield()
to not panic no ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what happened, but you must not have available the current sources somehow.
The actual comment now states, I think I adapted it after an earlier discussion:
Meaning,
esp_break()
is intended for both SYS and CONT.With regard to
yield()
panicking in SYS, whereasdelay(0)
does not andesp_break()
of course does neither, I think this was discussed and it was stated thatyield()
shall intentionally continue panicking when called from anywhere else but CONT.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to disable my previous answer before the last one. Sorry that this confused you.
So you propose
esp_break()
for both sys and cont becauseyield()
is for cont only, while they both do the same job, likedelay(0)
which currently is used to replaceyield()
everywhere where it is needed for sys and cont.Then, you replace
delay(0)
by the new sys+contyield()
taste.So we have now
yield()
,delay(0)
,esp_break()
?Why not simply
yield()
with a comment ?If the earlier discussion you refer to is that one, it also says:
@devyte maybe you can elaborate on this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@d-a-v Thanks, one can never look too many times at the code. I'm going to explain next that it's a bit different than you think, but that wasn't helped by me replacing
delay(0)
byyield()
on time too often - instead of byesp_break()
(5c39094).Delay(0)
is either pointless, in those places where the code runs only ever from CONT, so for final clarity and to let the runtimepanic
to express that contract, I'm replacing it byyield()
. Again, only in those places.Wherever code may run from SYS (and perhaps from CONT, too), the new
esp_break()
must be used to replacedelay(0)
. This is to make the intention clear not topanic
in SYS, which I find obfuscated by a zero timedelay(0)
call.As you can see,
yield()
(intentional panic in SYS) is not the same asesp_break()
, and my reservations aboutdelay(0)
I've explained above.