| 
 
| 定义了一个4字节union,包含位段,但是编译的时候出现错误如下, Error   [264] D:\Projects\clock_module\firmware\lmk04031.h; 49.20 bad bitfield type
 Error   [264] D:\Projects\clock_module\firmware\lmk04031.h; 50.20 bad bitfield type
 Error   [264] D:\Projects\clock_module\firmware\lmk04031.h; 51.19 bad bitfield type
 
 附上源代码
 
 typedef volatile unsigned long int ulint32;
 
 union
 {
 ulint32 R;
 struct
 {
 ulint32 ADDR:4;//address
 ulint32 CLKout_DLY:4;//clock channel delay control bits value
 ulint32 CLKout_DIV:8;//clock channel divide value
 ulint32 EN_CLKout:1;//clock channel output enable control bit
 ulint32 CLKout_MUX:2;//clock channel multiplexer control bits
 ulint32 CLKout_STATE:4;//state control bits for LVCMOS modes,0000 reserved due to LVDS output
 ulint32 CLKout_PECL_LVL:1;//LVPECL output format control,invalid due to LVDS output
 ulint32 reserved:8;//reserved values 0x01
 }B;
 }R0;//R0 register
 请大家分析一二,非常感谢,50分献上!
 | 
 |