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

Move constants to program memory #7

Open
kierdavis opened this issue Aug 6, 2017 · 0 comments
Open

Move constants to program memory #7

kierdavis opened this issue Aug 6, 2017 · 0 comments

Comments

@kierdavis
Copy link
Member

On AVR devices such as the Arduino, any data that is not marked as PROGMEM will be copied into SRAM at startup, as that is the AVR's main address space. This means that a significant amount of SRAM is occupied by data that is never modified and so would be better suited to being stored in the larger, read-only Flash memory segment.

This is easy to do for individual numbers and strings, but gets nontrivial for structs such as CommandHandler as special standard library functions need to be used to read data from flash memory instead of RAM.

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