atmega8 Flash的使用

 

GCCAVR中读取Flash区数据


定义(只能为全局变量):
const int temp PROGMEM = 1;
读取:
pgm_read_byte(addr);
pgm_read_word(addr);
pgm_read_dword(addr);

字符串:

全局定义:
const char ss[]PROGMEM = "hello";
函数内定义:
const char *ss = PSTR("hello");

读取同上

注意包含:#include <avr/pgmspace.h>

原文地址:https://www.cnblogs.com/pang123hui/p/2309870.html