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

RAM savings with http responseCodeStrings to progmem #1732

Closed
ghost opened this issue Mar 7, 2016 · 0 comments
Closed

RAM savings with http responseCodeStrings to progmem #1732

ghost opened this issue Mar 7, 2016 · 0 comments

Comments

@ghost
Copy link

ghost commented Mar 7, 2016

As I found a lot of strings in the webserver library, I tried to patch it to use progmem with F("") and returning a string. Is seems to work fine and saves 688 bytes of global RAM.

Just this code was changed:

String ESP8266WebServer::_responseCodeToString(int code) {
  switch (code) {
    case 100: return F("Continue");
    case 101: return F("Switching Protocols");
    case 200: return F("OK");
    case 201: return F("Created");
..
..

Don't know if this is the best approach, but would like to save RAM where possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant