#define bitset(var, bitno) ((var) |= (1 << (bitno)))
#define bitclr(var, bitno) ((var) &= ~(1 << (bitno)))
这个宏定义,是用来干什么的啊,有谁能给我解释一下,谢谢了!
union {
struct {
unsigned b0:1;
unsigned b1:1;
unsigned b2:1;
unsigned b3:1;
unsigned b4:1;
unsigned b5:1;
unsigned b6:1;
unsigned b7:1;
}oneBit;
unsigned char allBits;
} myFlag;
#define CNT2_1 myFlag.oneBit.b1
#define CNT2_2 myFlag.oneBit.b2
#define CNT2_3 myFlag.oneBit.b3
#define CNT2 myFlag .allBits
第一次见这种定义方式,知道有unsigned char unsigned int 这种unsigned b0.。。啥意思? |