I have noticed that even if an array of C++ strings is declared as const, the resulting data is stored in RAM rather than FLASH memory. For instance
const string teststring[] = {
"String1",
"String2",
};
stores the data in RAM. With large arrays - like text menus - this can eat up a lot precious RAM.
To confirm this, I made a test program that prints the amount of free memory either with or without an 8000-char const string array. Including the array causes free RAM to drop from 24,196 bytes to 13,476 bytes.
This program explores how the compiler treats const string arrays.
Am I missing a storage type keyword like "ROM" or "FLASH" or something?
I have noticed that even if an array of C++ strings is declared as const, the resulting data is stored in RAM rather than FLASH memory. For instance
stores the data in RAM. With large arrays - like text menus - this can eat up a lot precious RAM.
To confirm this, I made a test program that prints the amount of free memory either with or without an 8000-char const string array. Including the array causes free RAM to drop from 24,196 bytes to 13,476 bytes.
Import programstringtest
This program explores how the compiler treats const string arrays.
Last commit 05 Apr 2011 by Hexley Ball
Am I missing a storage type keyword like "ROM" or "FLASH" or something?