union{
struct
{
uchar ready:1;
uchar guard:1;
uchar speak:1;
uchar shutup:1;
}bit;
uchar byte;
}memory_addr; //**标志
#define memory_flag memory_addr.byte
#define ready_flag memory_addr.bit.ready
#define guard_flag memory_addr.bit.guard
#define speak_flag memory_addr.bit.speak
#define shutup_flag memory_addr.bit.shutup
如上是我在C文件中的定义,在头文件中如何作extern输出。。。网上找了N久也没发现类似例子,特来21IC求教 |