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

[sw/uart] allow for escaped percent sign #531

Merged
merged 1 commit into from
Mar 4, 2023

Conversation

NikLeberg
Copy link
Collaborator

Hi there!

The current printf implementation did not allow me to print a single % by escaping it with an additional percent sign in front %%. This is supported in the standard implementation.

If I put two, it printed out two. If I put only one, it printed %<break> with cutecom (Maybe misconfiguration on my end? PuTTY correctly showed only %.)

Anyway this small pr adds support for it.

I assume that the custom implementation of printf is deliberately kept small and need not be compliant with all the quirks of the official rules (for example floats are left out). So feel free to decline this pr if it would add to much bloat.

Cheers, Nik

@NikLeberg NikLeberg force-pushed the sw/printf_percentage_escape branch from 0d4a6ab to 096a683 Compare March 4, 2023 11:31
@stnolting
Copy link
Owner

Hey Nik!

Seems like I have never used a % in a string... 😅 For fancy printing I use ee_printf. However, I think this is a nice add-on making the "simple" printf more convenient. Could you update this after #509 has been merged?

@stnolting stnolting added enhancement New feature or request SW software-related labels Mar 4, 2023
@akaeba
Copy link
Collaborator

akaeba commented Mar 4, 2023

Hi Nik, and i use for advanced printing nanoprintf.

@NikLeberg NikLeberg force-pushed the sw/printf_percentage_escape branch from 096a683 to a24036e Compare March 4, 2023 18:08
@NikLeberg
Copy link
Collaborator Author

Could you update this after #509 has been merged?

Done. Thanks for the feedback and ideas!

@stnolting
Copy link
Owner

Thank you for contributing!

@stnolting stnolting merged commit ea38809 into stnolting:main Mar 4, 2023
@NikLeberg NikLeberg deleted the sw/printf_percentage_escape branch March 4, 2023 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request SW software-related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants