stractures defination in HS08 freescale code warrior

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

stractures defination in HS08 freescale code warrior

2,294件の閲覧回数
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 返答(返信)

744件の閲覧回数
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 件の賞賛
返信

744件の閲覧回数
chalapathi
Contributor I
Hi CrasyCat,
Thank you very much.
-Venkat
 
0 件の賞賛
返信