|
PUTTING STRINGS INTO FLASH
E-mail:
info@telesys.ru
This can be done on individual strings or for the whole application/file using the option
--string_literals_in_flash. Examples on how to put individual strings into
flash:
__flash char str1[] = "abcdef";
__flash char str2[] = "ghi";
__flash char __flash * pVar[] = { str1, str2 };
String literals cannot be put in flash automatically, but you can use a local static variable
instead:
#include
void f (int i)
{
static __flash char sl[] = "%d cookies\n";
printf_P(sl, i);
}
This does not result in more code compared to allowing string literals in flash.
Ответы