implemented yield_wait_for#575
Open
addrian-77 wants to merge 7 commits intotock:masterfrom
Open
Conversation
Contributor
|
@addrian-77 can we move forward with this? Please fix the ci issues. |
Signed-off-by: addrian-77 <lunguadrian30@gmail.com>
Signed-off-by: addrian-77 <lunguadrian30@gmail.com>
alexandruradovici
requested changes
Aug 5, 2025
|
|
||
| share::scope(|subscribe| { | ||
| // Subscribe to the button callback. | ||
| Buttons::register_listener(&listener, subscribe).unwrap(); |
Contributor
There was a problem hiding this comment.
yield-wait-for does not trigger the callback, it returns the arguments for the callback when yield-for-returns.
| } | ||
| } | ||
|
|
||
| fn yield_wait_for(driver_number: u32, subscribe_number: u32) { |
Contributor
There was a problem hiding this comment.
Suggested change
| fn yield_wait_for(driver_number: u32, subscribe_number: u32) { | |
| fn yield_wait_for(driver_number: u32, subscribe_number: u32) -> (u32, u32, u32) { |
yield-wait-for returns values instead of calling an upcall, all registers return. This is similar to yield-no-wait, but it only returns r1.
Author
There was a problem hiding this comment.
The first u32 is always 3, and the rest are driver_number and subscribe_number?
Signed-off-by: addrian-77 <lunguadrian30@gmail.com>
alexandruradovici
requested changes
Aug 5, 2025
| } | ||
|
|
||
| // Wrapper for yield_wait_for | ||
| pub fn wait_for_button(driver_number: u32, subscribe_number: u32) { |
Contributor
There was a problem hiding this comment.
Suggested change
| pub fn wait_for_button(driver_number: u32, subscribe_number: u32) { | |
| pub fn wait_for_button(driver_number: u32, subscribe_number: u32) -> (u32, ButtonState) { |
Contributor
|
Yes, but it returns values.On Aug 5, 2025, at 11:59, Adrian Lungu ***@***.***> wrote:
@addrian-77 commented on this pull request.
In platform/src/syscalls_impl.rs:
@@ -35,6 +35,19 @@ impl<S: RawSyscalls> Syscalls for S {
}
}
+ fn yield_wait_for(driver_number: u32, subscribe_number: u32) {
The first u32 is always 3, and the rest are driver_number and subscribe_number?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
Signed-off-by: addrian-77 <lunguadrian30@gmail.com>
bradjc
reviewed
Aug 12, 2025
addrian-77
commented
Aug 13, 2025
| "yield-wait-for called with no queueued upcall" | ||
| ); | ||
| (r0, driver_number, subscribe_number) | ||
| } |
Author
There was a problem hiding this comment.
In this unittest, this function basically returns the same thing everytime, is this okay? What should happen if we don't have the expected upcall?
Signed-off-by: addrian-77 <lunguadrian30@gmail.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Added the function
yield_wait_for, which returns after the wanted Syscall occurs, pushing back into the queue other Syscalls.The function was tested inside
buttons_wait_for.rs, called withButtons::wait_for_button