×
单片机 > 单片机程序设计 > 详情

对AVRGGC中flash的指针操作说明

发布时间:2020-08-24 发布时间:
|
对AVRGGC中flash的指针操作说明: 
在flash数据声明: 
const prog_uchar table[]={6,7,8,9}; 
在flash指针声明: 
const prog_uchar *ptr;    或PGM_ptr; 

*ptr=table;    或ptr=&table; 
在SRAM声明变量 
uchar tmp; 

使用时应: 
tmp=pgm_read_byte(&table);或  tmp=pgm_read_byte(ptr) 
不能用:tmp=*ptr;否则数据是错误。
 

『本文转载自网络,版权归原作者所有,如有侵权请联系删除』

热门文章 更多
PIC单片机的多路AD切换程序设计