-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add new stdio_usb_call_chars_available_callback() function #2300
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
Conversation
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
lurch
reviewed
Feb 18, 2025
65badb4
to
2abdbf4
Compare
lurch
reviewed
Feb 19, 2025
When the user links in tinyUSB directly, the pico_stdio_usb library disables some of its functionality, including its built-in background processing thread. The user can implement their own background thread in order to continue using the stdio functionality, except that there is no wey to trigger the registered chars_available_callback. This commit adds a new `stdio_usb_run_chars_available_callback()` method to allow user's background threads to run the callback.
2abdbf4
to
c133e72
Compare
kilograham
reviewed
Mar 22, 2025
@@ -66,7 +66,7 @@ static void low_priority_worker_irq(void) { | |||
#endif | |||
mutex_exit(&stdio_usb_mutex); | |||
#if PICO_STDIO_USB_SUPPORT_CHARS_AVAILABLE_CALLBACK | |||
if (chars_avail && chars_available_callback) chars_available_callback(chars_available_param); | |||
if (chars_avail && chars_available_callback) stdio_usb_run_chars_available_callback(); |
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 think i'd revert this line... no point in calling another method here (which also checks chars_avail_callback
- id just call it directly to save introduction of the new function (which likely isn't otherwise called when this code is included
kilograham
approved these changes
Mar 22, 2025
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.
When the user links in tinyUSB directly, the pico_stdio_usb library disables some of its functionality, including its built-in background processing thread. The user can implement their own background thread in order to continue using the stdio functionality, except that there is no wey to trigger the registered chars_available_callback. This commit adds a new
stdio_usb_calls_chars_available_callback()
method to allow user's background threads to call the callback.