关于IAR使用结构变量的问题(msp430)
本帖最后由 skevil 于 2013-08-25 19:23:52 编辑
#define uchar unsigned char
struct FindGB16
{
uchar Index[3];
uchar data[32];
};
struct FindGB16 GB16[]= //为结构变量初始化
{
"我", 0x20,0x24,0x24,0x24,0xFE,0x23,0x22,0x20,
0xFF,0x20,0x22,0xAC,0x20,0x30,0x20,0x00,
0x00,0x08,0x48,0x84,0x7F,0x02,0x21,0x10,
0x09,0x06,0x1A,0x61,0x80,0xE0,0x00,0x00,
"有", 0x04,0x04,0x04,0x84,0xE4,0x3C,0x27,0x24,
0x24,0x24,0x24,0xF4,0x24,0x06,0x04,0x00,
0x04,0x02,0x01,0x00,0xFF,0x09,0x09,0x09,
0x09,0x49,0x89,0x7F,0x00,0x00,0x00,0x00,
"一", 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
0x80,0x80,0x80,0x80,0x80,0xC0,0x80,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
"个", 0x80,0x80,0x40,0x20,0x10,0x08,0x04,0xE3,
0x04,0x08,0x10,0x20,0x40,0xC0,0x40,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};
typedef struct
{
uchar Index[3];
uchar data[32];
}FindGB16;
const FindGB16 GB16[4]=
{
{
{"我"},//这里其实有问题,"我"这个字符串应该不止三个字节
{0x20,0x24,0x24,0x24,0xFE,0x23,0x22,0x20,
0xFF,0x20,0x22,0xAC,0x20,0x30,0x20,0x00,
0x00,0x08,0x48,0x84,0x7F,0x02,0x21,0x10,
0x09,0x06,0x1A,0x61,0x80,0xE0,0x00,0x00,
}
},
{
{"有"},
{
0x04,0x04,0x04,0x84,0xE4,0x3C,0x27,0x24,
0x24,0x24,0x24,0xF4,0x24,0x06,0x04,0x00,
0x04,0x02,0x01,0x00,0xFF,0x09,0x09,0x09,
0x09,0x49,0x89,0x7F,0x00,0x00,0x00,0x00,
}
},
........
};