Lothar M. wrote:
> you have one or some big (text) arrays
As expected: those "constant" strings are located in RAM. Each of the 44
strings is over 90 chars long and so its easy to see, that they sum up
to nearly 4k. The whole magic is here, that the compiler does some
optimizations to reduce that size to only 3k...
flip wrote:
> transfer these strings into program mem.
Thats the best way, because even when you keep them in RAM they are in
the program mem also, as they are needed to initialize the RAM at
startup.
But I would not stupidly transfer those strings to FLASH/PROGMEM.
Instead I would look for similarities and doubles and place them only
one time in the FLASH/PROGMEM.
So the strings
"ST<{\"cmd_code\":\"set_enable\",\"type\":\"widget\",\"widget\":"
and
"ST<{\"cmd_code\":\"set_image\",\"type\":\"image\",\"widget\":"
are used throughout the whole program several times. Its enough to
define them only once.
Or even more: those two parts of that strings are the same:
"ST<{\"cmd_code\":\"set"
and
"\",\"type\":\"widget\",\"widget\":"
so only the two parts "enable" and "image" must be changed.