keil中怎么用结构,联合定义位变量?

2019-03-24 16:31发布

keil中怎么用结构,联合定义位变量?我在ARM中这么定义正确吗? typedef union _MAC_FRAME_CONTROL
{
    WORD_VAL word;
    struct _MAC_FRAME_CONTROL_bits
    {
        unsigned char FrameType :3;
        unsigned char SecurityEnabled :1;
        unsigned char FramePending :1;
        unsigned char ACKRequest :1;
        unsigned char IntraPAN :1;
        unsigned char :1;
        unsigned char :1;
        unsigned char :1;
        unsigned char DstAddrMode :2;
        unsigned char :1;
        unsigned char :1;
        unsigned char SrcAddrMode :2;
    } bits;
} MAC_FRAME_CONTROL; 此帖出自小平头技术问答
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
1条回答
daicheng
2019-03-24 17:54
可以,只是看你WORD_VAL这个有没有定义了!

一周热门 更多>

相关问题

    相关文章