-
Notifications
You must be signed in to change notification settings - Fork 2.1k
sys/isrpipe: unit tests, doc, and fix init #21344
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
Conversation
Now the test works successfully on my |
You can squash the fixup and resolve the conversations. Also you can remove the |
I believe this ready to merge, pending an approval. |
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.
Tested and working on native
and a nucleo-g071rb
I have laying around. Please address the comment above before merging.
I rebased to take advantage of #21367. |
This patch adds unit tests for the isrpipe module.
The mutex used to sync the reader and writer of the pipe is initialized as unlocked. This results in a bit of wasted CPU cycles the first time a read blocks. This patch inits the mutex in a locked state so that the first blocking read blocks immediately.
This patch makes the requirement on buffer size more prominent. Additionally, it adds the missing argument to the doxygen block of the static initializer. Finally, it chanes the argument name passed to the static intializer to decouble the API from the implmentation details.
This patch documents what happens when a timeout occurs when isrpipe_read_all_timeout() has been called.
This patch makes the requirement on buffer size more prominent. Additionally, it adds the missing argument to the doxygen block of the static initializer.
Contribution description
This PR originally started out as a fix to isrpipe's init of it's mutex, but it grew into adding unit tests and improving its doc as well. I also improved some doc for
tsrb
. I can break that into a separate PR if you desire.Testing procedure
make -C tests/unittests/ tests-isrpipe test
Issues/PRs references
None known