本帖最后由 zhaoyimei 于 2022-5-20 19:58 编辑
编译环境:arduino1.8.19
- // ------------------ 汉字字模的数据结构定义 ------------------------ //
- typedef struct typFNT_GB16 // 汉字字模数据结构
- {
- signed char Index[2]; // 汉字内码索引
- char Msk[32]; // 点阵码数据
- };
- /////////////////////////////////////////////////////////////////////////
- // 汉字字模表 //
- // 汉字库: 宋体16.dot,横向取模左高位,数据排列:从左到右从上到下 //
- /////////////////////////////////////////////////////////////////////////
- struct typFNT_GB16 code GB_16[] = // 数据表
- {
- "实", 0x02,0x00,0x01,0x00,0x7F,0xFE,0x48,0x02,
- 0x86,0x84,0x02,0x80,0x10,0x80,0x0C,0x80,
- 0x04,0x84,0xFF,0xFE,0x01,0x00,0x01,0x40,
- 0x02,0x20,0x04,0x10,0x18,0x0C,0x60,0x04,
- "验", 0x08,0x40,0xFC,0x40,0x08,0xA0,0x48,0xA0,
- 0x49,0x10,0x4A,0x0E,0x4D,0xF4,0x48,0x00,
- 0x7C,0x48,0x06,0x48,0x05,0x48,0x1D,0x50,
- 0xE5,0x10,0x44,0x24,0x17,0xFE,0x08,0x00,
- "测", 0x00,0x00,0x40,0x44,0x27,0xE4,0x24,0x54,
- 0x85,0x54,0x65,0x54,0x25,0x54,0x0D,0x54,
- 0x15,0x54,0x25,0x54,0xE5,0x54,0x21,0x04,
- 0x22,0x84,0x24,0x44,0x28,0x54,0x20,0x08,
- "试", 0x00,0x20,0x40,0x28,0x20,0x24,0x20,0x20,
- 0x0F,0xFE,0x00,0x20,0xE0,0x20,0x27,0xE0,
- 0x21,0x20,0x21,0x10,0x21,0x10,0x21,0x10,
- 0x29,0xD2,0x37,0x12,0x22,0x0A,0x00,0x04
- };
复制代码
出现如下错误
- warning: 'typedef' was ignored in this declaration
- typedef struct typFNT_GB16 // 汉字字模数据结构
- ^~~~~~~
- error: expected initializer before 'GB_16'
- struct typFNT_GB16 code GB_16[] = // 数据表
- ^~~~~
- exit status 1
- expected initializer before 'GB_16'
复制代码 去掉typedef出现 error: expected initializer before 'GB_16' struct typFNT_GB16 code GB_16[] = // 数据表
去掉struct typFNT_GB16 code GB_16[] 中的code 出现1: error: initializer-string for array of chars is too long [-fpermissive]
谢谢!
|