This works for me:

     printf_P (PSTR("hello\n"));

But this doesn't (prints garbage):

     PGM_P hello_string = "hello\n";
     printf_P (hello_string);

Nor does this (complains about invalid initializer at printf_P line):

     PGM_P hello_string = "hello\n";
     printf_P (PSTR (hello_string));

How is PGM_P supposed to be used?

Is it perhaps defined incorrectly?  Doxygen says its:

  #define       PGM_P   const char *

Which doesn't mention PROGMEM at all?

Thanks,
Britton

_______________________________________________
AVR-chat mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/avr-chat

Reply via email to