教你如何使用atmega8 Flash
GCCAVR中讀取Flash區(qū)數(shù)據(jù)
定義(只能為全局變量):
const int temp PROGMEM = 1;
讀取:
pgm_read_byte(addr);
pgm_read_word(addr);
pgm_read_dword(addr);
字符串:
全局定義:
const char ss[]PROGMEM = "hello";
函數(shù)內(nèi)定義:
const char *ss = PSTR("hello");
讀取同上
注意包含:#include