View Single Post
Old 10-04-2010, 09:31 AM   #4 (permalink)
dcb
needs more cowbell
 
dcb's Avatar
 
Join Date: Feb 2008
Location: ÿ
Posts: 5,038

pimp mobile - '81 suzuki gs 250 t
90 day: 96.29 mpg (US)

schnitzel - '01 Volkswagen Golf TDI
90 day: 53.56 mpg (US)
Thanks: 158
Thanked 269 Times in 212 Posts
the PSTR function is a way to define a string (or other data), such that it isn't automatically loaded into ram but only in flash.

Code:
the following takes up an extra 16 bytes of ram, always:
 LCD::print("OpenGauge       ");

whereas this tells the compiler to not pre-allocate ram for the string, it will be fetched by getStr only when needed:
  LCD::print(getStr(PSTR("OpenGauge       ")));
You should make a visit to avrfreaks.net sometime, there is a plethora of tricks and gotchas with microcontrollers.
__________________
WINDMILLS DO NOT WORK THAT WAY!!!
  Reply With Quote