Where is PSTR defined or documented, do you know, westfw? I could not uncover it anywhere on the arduino site.
Hmm. It's part of the underlying gnu C compiler support (defined in <avr/pgmspace.h>) rather than part of the Arduino environment.
There's a nice tutorial here:
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=38003
All it really does is allow you to put quoted strings in function arguments into program memory, so you could have in your program: print_pstring(PSTR("this is a long string that will get stuck into progmem\n");
Instead of having to do the multiple steps:
static char mystring[] PROGMEM = "this is a long string that will get stuck into progmem\n";
//later:
print_pstring(mystring);
I would have thought PSTR would be at least mentioned in the Arduino reference on PROGMEM (http://www.arduino.cc/en/Reference/PROGMEM), but you're correct that there doesn't seem to be anything there. Note that none of the Arduino core functions (like Serial.print()) support PSTR, and it doesn't seem to be possible for C++ to tell the difference between a progmem string and a RAM string (so that the right thing can happen automagically), so perhaps the omission is designed to prevent inadvertent bugs like:Serial.print(PSTR("Look, I'm saving RAM space"));