stractures defination in HS08 freescale code warrior

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

stractures defination in HS08 freescale code warrior

1,814 Views
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
Labels (1)
0 Kudos
2 Replies

264 Views
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 Kudos

264 Views
chalapathi
Contributor I
Hi CrasyCat,
Thank you very much.
-Venkat
 
0 Kudos