stractures defination in HS08 freescale code warrior

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

stractures defination in HS08 freescale code warrior

2,295 次查看
chalapathi
Contributor I
Hi,
Can some one suggest me how to utilize the bit field stracture defined in another, using storage calass in some other file.
 
Example  : /* Var.C */
 
typedef struct Bit_Flags {
        unsigned  SPI_RXTX_Flag :1; 
        unsigned  Temp2         :1;
        unsigned  Temp3         :1;
        unsigned  Temp4         :1;
        unsigned  Temp5         :1;
        unsigned  Temp6         :1;
        unsigned  Temp7         :1;
        unsigned  Temp8         :1;
}Flag1;
 
/* Main.c*/
 
Flag1 Status_Flags;
 
/*in Main.c below statement gives an error of undefined storage class ? how to specify storage class here? */
 
 Status_Flags.SPI_RXTX_Flag=0; 
 
please suggest the solution .
 
Thanks
Venkat
标签 (1)
0 项奖励
回复
2 回复数

745 次查看
CrasyCat
Specialist III
Well I would say you need to define the typedef for the structured type in a header file and include the header file in each source file where you are using the bitfield.
 
CrasyCat
0 项奖励
回复

745 次查看
chalapathi
Contributor I
Hi CrasyCat,
Thank you very much.
-Venkat
 
0 项奖励
回复