I know storing strings in flash memory saves on RAM, but does the same hold true for numeric constants?
For example:
// Say you have a function that takes four numbers
void foo(uint8_t a, uint8_t b, uint8_t c, uint8_t d)
{
/* do something here */
}
// Then for whatever reason it's used in a loop with data from an array
const uint8_t array[3][4] =
{
{240, 54, 12, 53},
{122, 8, 59, 22},
{8, 0, 255, 127}
};
for (uint8_t i = 0; 3 > i; i++)
{
foo(array[i][0], array[i][1], array[i][2], array[i][3]);
}
// This example is small, but let's say the array is much larger and with more loop iterations
Is there any benefit in putting the array in flash memory via PROGMEM, or is the array already stored there because it's a const data type?
Would it make a difference if it was not a const data type?
Thanks for any replies,
DJ