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.
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
Renamings for that
esp_yield
is really suspend, replacing delay(0), shimmable suspend-CONT API for async esp_suspend() / esp_schedule() #7148Renamings for that
esp_yield
is really suspend, replacing delay(0), shimmable suspend-CONT API for async esp_suspend() / esp_schedule() #7148Changes from 21 commits
4df7186
b64622d
9bb4894
97d59ae
08ed7d0
397408f
0bb470c
971ad28
99ed6fc
cd8d2d3
070eb48
d11be8b
4b92d28
208c4a3
3720ac0
3be70a4
67ced12
62af940
863c482
679ecb1
6199eb9
7cfaeea
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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)
?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.