Skip to content
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

stdio/rtt: Don't silently drop println statements #278

Merged

Conversation

chrysn
Copy link
Collaborator

@chrysn chrysn commented Apr 30, 2024

This still silently truncates prints, but during printf debugging, those are still understood more easily than skipped lines.


We're probably migrating to something more defmt anyway, but this fixes a repeated issue I've been running into when I thought my code is in weird branches just because the printf("Stage 1 {:?}", ...) silently didn't do anything at all.

(At some point we'll probably have similar high-level stdio discussions as in riot-c regarding whether to block and what to do in ISRs, but this is just a small step here and shouldn't touch the controversial topics).

This still silently truncates prints, but during printf debugging, those
are still understood more easily than skipped lines.
@chrysn chrysn requested a review from kaspar030 April 30, 2024 12:01
@kaspar030
Copy link
Collaborator

So this makes the output always blocking? would that stall applications when there's no debugger attached?

@kaspar030
Copy link
Collaborator

So this makes the output always blocking? would that stall applications when there's no debugger attached?

ah no, that would be BlockIfFull.

Somehow I was under the impression that probe-rs actually switches to blocking mode if it is attached, but I can't find a reference anymore.

anyhow, trimming is better than fully skipping. so, lgtm.

@kaspar030 kaspar030 added this pull request to the merge queue Apr 30, 2024
Merged via the queue into future-proof-iot:main with commit 443b36a Apr 30, 2024
19 checks passed
@chrysn chrysn deleted the rtt-no-silent-drop branch May 14, 2024 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants