天天看点

warning: missing braces around initializer

warning: missing braces around initializer

这主要发生在结构体中多维或多个数组初始化的时候,其错误发生的原因是没有用大括号明确的区分出初始化数据的归类,改正的方法如下例子:

struct chinese_12_12        // 12*12汉字字模数据结构

{

    unsigned char Index[2];

    unsigned char Msk[24];

};

const struct chinese_12_12 ch_12_12[] PROGMEM=

{

{{"武"}, {0x01,0x80,0x7D,0x40,0x01,0x40,0xFF,0xE0,

 0x11,0x00,0x51,0x00,0x5F,0x00,0x51,0x00,

 0x50,0xA0,0x5E,0xA0,0xE0,0x60,0x00,0x00}},

{{"汉"}, {0x40,0x40,0x2F,0xE0,0x04,0x40,0x94,0x40,

 0x54,0x80,0x22,0x80,0x22,0x80,0xC1,0x00,

 0x42,0x80,0x44,0x40,0x58,0x20,0x00,0x00}}

};

继续阅读