-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ESP reboot on using PSTR() within sprintf function call #484
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
Comments
you mean
|
@Links2004 |
You can't use PSTR() with functions that don't end in _P, it won't work correctly. Links2004 link is incorrect, it should be Are you including "avr/pgmspace.h"? If so that doesn't work. You need to include just "pgmspace.h". Further, it looks like sprintf_P is not listed, but snprintf_P is. I will add this, but if you want a work around, you can use snprintf_P instead. |
This results into a reboot:
char str[80];
sprintf(str,PSTR("This is a demo: %s for sprintf from flash"),"test123");
Serial.println(str);
Or should I be using sprint_P() but that seems unavailable on ESP.
How to use progmem strings as param to sprintf() ?
The text was updated successfully, but these errors were encountered: