求助:PROGMEM用法---如何定义一个指针指向FLASH区字符串????? 求助:如何定义一个指针指向FLASH区字符串?
#include <stdint.h> #include <AVR/pgmspace.h>
//字符串在FLASH里 /* const char FLASH_STR0[] PROGMEM ="0AAAAAAAAA" ; const char PROGMEM FLASH_STR1[] ="1AAAAAAAAA" ; const PROGMEM char FLASH_STR2[] ="2AAAAAAAAA" ; PROGMEM const char FLASH_STR3[] ="3AAAAAAAAA" ; */
//字符串在SRAM里 /* const char * flash_str0 PROGMEM ="0aaaaaaaaaa" ; const char * PROGMEM flash_str1 ="1aaaaaaaaaa" ; const char PROGMEM * flash_str2 ="2aaaaaaaaaa" ; const PROGMEM char * flash_str3 ="3aaaaaaaaaa" ; PROGMEM const char * flash_str4 ="4aaaaaaaaaa" ; */
//能够加PROGMEM都加上了,还是不行。字符串还是在SRAM中! PROGMEM const PROGMEM char PROGMEM * PROGMEM _flash_str PROGMEM =(PROGMEM const PROGMEM char PROGMEM * PROGMEM)"0_aaaaaaaaa" ;
int main() { while(1);
}
|