Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add printf to print class#28

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
MCUdude wants to merge1 commit intoarduino:master
base:master
Choose a base branch
Loading
fromMCUdude:master

Conversation

MCUdude
Copy link

Printf is super useful. This PR will let users use Serial.printf

henrygab and gbr1 reacted with thumbs up emoji
@PaulStoffregen
Copy link

Didn't Massimo (@mbanzi) say very clearly, only 2 weeks ago on the developers mail list, that this would not be accepted?

@MCUdude
Copy link
Author

That may be true, but I'm not in the developer mailing list 😉
I don't quite see why printf is such a bad thing to have available though.

@PaulStoffregen
Copy link

I'm not going to argue this. My only point is this has been proposed over and over, and the Arduino devs have clearly said it does not belong in Arduino's API. Now that you know this, you can look up what they've said and argue if you like.

@MCUdude
Copy link
Author

Did some google-fu and found the threads you're referring to. It's really weird, but many (most) of the "We should implement printf in print class" discussions ends up with ranting and personal attacks.

Personally I'd love to see this merged because Ipersonally find printf easy to use and understand. However I'd of course respect if the Arduino Gods have a different opinion than me.

I'll leave this open until it's merged or closed by any of the developers.

@per1234
Copy link
Collaborator

I believe this is the specific statement from Massimo Banzi that Paul Stoffregen referred to:
https://groups.google.com/a/arduino.cc/d/msg/developers/E0pUPWeDE2Y/GPWl9Nw1BwAJ

Related:
https://github.com/arduino/Arduino/issues/2416

@PaulStoffregen
Copy link

Clearly a lot of people have strong feelings on this matter. Some of those folks may have more passion than wisdom.

FWIW, I have some printf code similar to what Bill Perry suggested just today, but it uses Arduino's Print class rather than duplicating so much code and allocating big buffers. When I get a break in working on hardware, I'm planning to turn it into a nice library that works on all boards.

henrygab reacted with thumbs up emojihenrygab reacted with heart emoji

@Floessie
Copy link

@PaulStoffregen

I have some printf code similar to what Bill Perry suggested just today

Paul, could you add a link, please? Just out of interest...

@per1234
Copy link
Collaborator

could you add a link, please? Just out of interest...

I believe this is it:
https://groups.google.com/a/arduino.cc/d/msg/developers/sTacUMEXBTw/H2v9GabLBAAJ

@PaulStoffregen
Copy link

PaulStoffregen commentedMar 21, 2019
edited
Loading

Bill's code allocates a 128 byte buffer on the stack.

Sorry, my own no-buffer printf code isn't public at this time. I already maintain a couple dozen libs, which regularly get requests for platform-specific issues (the ESP folks are the worst - so much breaks on those chips...), so I'm not very inclined to release yet another library in an "alpha" quality state.

Edit: Just to be clear, technically any "no buffer" code that relies on Arduino's Print class does involve a 33 byte buffer allocated on the stack, due to Arduino's Print::printNumber() function.

Floessie reacted with laugh emoji

@CLAassistant
Copy link

CLAassistant commentedApr 9, 2021
edited
Loading

CLA assistant check
All committers have signed the CLA.

@JAndrassy
Copy link
Contributor

my StreamLib enables to use printf without support in core API.
https://github.com/JAndrassy/StreamLib#formatted-printing
and the implementation doesn't use a buffer. it has avr, arm end esp implementation.
https://github.com/JAndrassy/StreamLib/blob/master/src/PrintPlus.cpp

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Print.h add printf API
6 participants
@MCUdude@PaulStoffregen@per1234@Floessie@CLAassistant@JAndrassy

[8]ページ先頭

©2009-2025 Movatter.jp