打印
[AVR单片机]

结构体数组初始化

[复制链接]
1809|5
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
自由自在2013|  楼主 | 2014-10-24 11:47 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
typedef struct  /*12*12 汉字字模显示数据结构,一个汉字分为上下两层*/
{     
  char Index[2];//一个汉字占两个字节     
  char Msk[24];//一个汉字的编码由24个十六进制数组成
}GB_12;

__flash unsigned char GB_12[]=
{
{0xEF,0x09,0xF9,0x4F,0x40,0xFF,0x49,0x49,0x49,0x79,0x01,0x00,0x07,0x04,0x03,0x02,//"距"
0x02,0x07,0x04,0x04,0x04,0x04,0x04,0x00},

{0x02,0x82,0xBE,0xA2,0xB6,0xEB,0xB6,0xA2,0xBE,0x82,0x02,0x00,0x00,0x07,0x00,0x02,//"离",
0x03,0x02,0x02,0x03,0x04,0x07,0x00,0x00},

{0x89,0x72,0x00,0xC0,0x5F,0xD5,0x55,0xD5,0x55,0xDF,0x00,0x00,0x07,0x00,0x04,0x07,//"温",
0x04,0x07,0x04,0x07,0x04,0x07,0x04,0x00},

{0x00,0xFE,0x0A,0x8A,0xBE,0xAA,0xAB,0xAA,0xBE,0x0A,0x0A,0x00,0x06,0x01,0x04,0x04,//"度",
0x04,0x03,0x02,0x03,0x04,0x04,0x04,0x00},

{0x10,0x08,0xFC,0xAB,0xAA,0xFA,0xAE,0xAA,0xA8,0xF8,0x00,0x00,0x04,0x02,0x01,0x00,//"角",
0x00,0x07,0x00,0x04,0x04,0x07,0x00,0x00},

{0x00,0xFE,0x0A,0x8A,0xBE,0xAA,0xAB,0xAA,0xBE,0x0A,0x0A,0x00,0x06,0x01,0x04,0x04,//"度",
0x04,0x03,0x02,0x03,0x04,0x04,0x04,0x00}
};

为什么这个初始化总报错?
Error[Pe067]: expected a "}" E:\京东\IAR+Nokia5110\settings\lcd_char.c 332

相关帖子

沙发
ningling_21| | 2014-10-24 11:59 | 只看该作者
不符合语法

使用特权

评论回复
板凳
wangch_sh| | 2014-10-24 20:26 | 只看该作者
你定义了一个结构体数组,可是初始化却不是结构体。

使用特权

评论回复
地板
SD10A| | 2014-10-25 22:43 | 只看该作者

typedef struct  /*12*12 汉字字模显示数据结构,一个汉字分为上下两层*/
{     
   
  char Msk[24];//一个汉字的编码由24个十六进制数组成
}GB_12[5]=
{
{0xEF,0x09,0xF9,0x4F,0x40,0xFF,0x49,0x49,0x49,0x79,0x01,0x00,0x07,0x04,0x03,0x02,//"距"
0x02,0x07,0x04,0x04,0x04,0x04,0x04,0x00},

{0x02,0x82,0xBE,0xA2,0xB6,0xEB,0xB6,0xA2,0xBE,0x82,0x02,0x00,0x00,0x07,0x00,0x02,//"离",
0x03,0x02,0x02,0x03,0x04,0x07,0x00,0x00},

{0x89,0x72,0x00,0xC0,0x5F,0xD5,0x55,0xD5,0x55,0xDF,0x00,0x00,0x07,0x00,0x04,0x07,//"温",
0x04,0x07,0x04,0x07,0x04,0x07,0x04,0x00},

{0x00,0xFE,0x0A,0x8A,0xBE,0xAA,0xAB,0xAA,0xBE,0x0A,0x0A,0x00,0x06,0x01,0x04,0x04,//"度",
0x04,0x03,0x02,0x03,0x04,0x04,0x04,0x00},

{0x10,0x08,0xFC,0xAB,0xAA,0xFA,0xAE,0xAA,0xA8,0xF8,0x00,0x00,0x04,0x02,0x01,0x00,//"角",
0x00,0x07,0x00,0x04,0x04,0x07,0x00,0x00},

{0x00,0xFE,0x0A,0x8A,0xBE,0xAA,0xAB,0xAA,0xBE,0x0A,0x0A,0x00,0x06,0x01,0x04,0x04,//"度",
0x04,0x03,0x02,0x03,0x04,0x04,0x04,0x00}
};

使用特权

评论回复
5
SD10A| | 2014-10-25 22:43 | 只看该作者
你照着这个样子试验下 看看能不能行

使用特权

评论回复
6
efen| | 2014-10-28 15:36 | 只看该作者
__flash GB_12 table_GB_12[]={};

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

26

主题

83

帖子

3

粉丝