Following the example of printf_P, I added a couple routines to my own code
that took string literals. My code reads from program space, and I pass the
literals using PSTR("foo"). It's my own version, rewritten to avoid compiler
warnings:
#define PROG_MEM __attribute__((section(".progmem.workaround")))
#undef PSTR
#define PSTR(s) (__extension__({static char const __c[] PROG_MEM = (s);
&__c[0];}))
when I replace a call like
printf("Foo\n");
with
printf_P(PSTR("Foo\n"));
I see a corresponding drop (four bytes, in this case) in my data section size.
But when I do the same thing with my own routines, I see no change in size. My
routines are declared like this:
void lcdPuts(uint8_t pos, const char *p);
void lcdPuts_P(uint8_t pos, const char *p);
Is there something I'm overlooking?
Thanks,
Rick
_______________________________________________
AVR-chat mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/avr-chat