共用体:
//common.h typedef union { struct { unsigned fTIME_5MS : 1; unsigned TIME_5MS : 1; unsigned TIME_10MS : 1; unsigned TIME_30MS : 1; unsigned TIME_50MS : 1; unsigned TIME_1S : 1; }; struct { unsigned int TimeBaseAll; }; }TIME_BASE;//用typedef定义的新变量名,要放在后面 extern volatile TIME_BASE TimeBase;//声明共用体
//timer.c volatile TIME_BASE TimeBase;//定义共用体
结构体