编译器对于flash的常量定义采用关键词const就可以。比如keil,ICC等定义常量采用 const unsigned char data=0;则data的类型为常量存储在flash中。
如下定义:
typedef struct typFNT_ASC16
{
char Index[1];
char Msk[16];
};
const struct typFNT_ASC16 ASC_16[] =
{
"1",0x00,0x00,0x08,0x08,0xFC,0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x07,0x04,0x04,0x00,
"2",0x00,0x00,0x08,0x04,0x84,0x44,0x38,0x00,0x00,0x00,0x06,0x05,0x04,0x04,0x04,0x00,
"3",0x00,0x00,0x08,0x04,0x44,0x44,0xB8,0x00,0x00,0x00,0x02,0x04,0x04,0x04,0x03,0x00,
"4",0x00,0x00,0x80,0x60,0x18,0xFC,0x00,0x00,0x00,0x00,0x01,0x01,0x05,0x07,0x05,0x00,
"5",0x00,0x00,0x7C,0x44,0x44,0x44,0x84,0x00,0x00,0x00,0x02,0x04,0x04,0x04,0x03,0x00,
"6",0x00,0x00,0xF0,0x48,0x44,0x44,0x80,0x00,0x00,0x00,0x03,0x04,0x04,0x04,0x03,0x00,
"7",0x00,0x00,0x0C,0x04,0x84,0x64,0x1C,0x00,0x00,0x00,0x00,0x06,0x01,0x00,0x00,0x00,
"8",0x00,0x00,0xB8,0x44,0x44,0x44,0xB8,0x00,0x00,0x00,0x03,0x04,0x04,0x04,0x03,0x00,
"9",0x00,0x00,0x38,0x44,0x44,0x44,0xF8,0x00,0x00,0x00,0x00,0x04,0x04,0x02,0x01,0x00,
"0",0x00,0x00,0xF8,0x04,0x04,0x04,0xF8,0x00,0x00,0x00,0x03,0x04,0x04,0x04,0x03,0x00
};
只要定义成const 就可以了。
另外关于GCC的flash 定义比较特别,详情请参考:http://hi.baidu.com/fujianhuangjia/blog/item/52df50373ce1eff61b4cff13.html
上一篇:Atmega328p-pu与Atmega16A-PU区别
下一篇:AVR之心路历程 - 1. 串口ISP烧录器
推荐阅读最新更新时间:2024-11-02 17:23
设计资源 培训 开发板 精华推荐
- 使用符合 EN55022 A 类(双输出)EMC 滤波的 RP40-2405SFR DC/DC 转换器的典型应用
- LDK715 高输入电压 85 mA LDO 线性稳压器的典型应用
- AP2132 2A CMOS LDO REGULATOR固定版典型应用
- 用于计量的模拟放大
- 基于IP5358的188数码管移动电源
- CY4608M,Multi-TT HX2VL 超低功耗 4 端口集线器开发套件
- 万用表6F22-9V锂电池
- 鲍鱼Stm32焊台 高端1.3寸OLED显示屏 鲍鱼T12焊台
- LTC2992CDE 功率效率计的典型应用
- OP484FSZ-REEL7 3V 单电源、50Hz 至 60Hz 有源陷波滤波器和假接地的典型应用