Skip to content

Conversation

mcspr
Copy link
Owner

@mcspr mcspr commented Dec 6, 2020

Tracking branch removing Arduino.h dependency

  • String -> std::string
  • String(x) -> sprintf(buffer, x)
  • fix union ctors & dtors
  • update callbacks to use cstrings (since we still want arduino to be able to read those). no string_view's yet :(

@mcspr
Copy link
Owner Author

mcspr commented Dec 6, 2020

fwiw it is the same binary size for the current dev of espurna, RAM is slightly better. main reason for that is terminal implementation changes, where unordered_map is no longer included. turns out, string is about the same size

only significant issue is rpn_value:toString() for floats, since floats formatting is completely disabled there (but, it simply does String(double value, 10) instead of calling the build-in method). not really sure how to pull this off without the correct printf, besides pulling dtostrf code right here.

note that std::to_string will use printf as well, if it did actually work for the platform
(to be specific, it uses vsnprintf + alloca, which is.... interesting choice, wonder why it is that way)

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

Successfully merging this pull request may close these issues.

1 participant