-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Allow println to send \n
and not \r\n
#7364
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
I'm not sure if adding this to the API really is a good idea (to avoid cluttering the API). Doing a manual print("\n")
can already do what you want, of course.
I understand not wanting clutter. I can reimplement this with a switch.
Maybe an option to choose between \n
and \r\n
.
Serial.setln("\n");
maybe?
I am working with large code bases many times new programmers where at times the difference betwen \r\n
and \n
. The code works, but the serial line endings are all over the place.
Refractoring the code is hard because it is challenging to test hardware with automated tests.
Would you consider alternative ways to changing the line ending?
@matthijskooijman I changed the implementation now to be less polluting. Default behaviour is the same, but it should be much easier to change the line endings if the user wants to.
let me know what you think
\n
and not \r\n
(追記ここまで)
This looks a lot better to me. I do still see a lot of whitespace changes in your PR, those must certainly be removed before merging.
One other question is the performance impact of this change. I wonder if the compiler is smart enough to optimize the line ending variable away.
Finally, it's not my call to merge this, but @cmaglie's or @facchinm's.
@matthijskooijman, Thanks for considering this. I will remove the whitespace if the PR is considered.
321859e
to
10570eb
Compare
I guess I found the new home for this code
Correct, thanks!
No description provided.