-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Add support to Print::printf for printing from flash #2266
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
@igrr is travis borked? |
As discussed, such functionality should not be expected from printf
Current coverage is 27.64%
|
@@ -63,6 +63,53 @@ size_t Print::printf(const char *format, ...) { | |||
return len; | |||
} | |||
|
|||
size_t Print::printf(const __FlashStringHelper * format, ...) { |
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.
How about introducing Print:vprintf(PGM_P format, va_list argp) and make the other 2 use it?
size_t Print::printf(const __FlashStringHelper * format, ...) {
va_list arg;
va_start(arg, format);
PGM_P fmt = reinterpret_cast<PGM_P>(format);
size_t len = vprintf(fmt, arg);
va_end(arg);
return len;
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.
removed that printf all together. Check the latest commit
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.
Good enough.
@me-no-dev |
No description provided.