Hi,
Currently, i’m using the Keil-MDK IDE for my projects and i like to use the embedded studio to test my codes with GCC and/or LLVM.
Unfortunately, i need packed structures for the communication with other system. I#m using the ARM Compiler Keyword packed for this.
What would be the right way to declare these structures compiler independent?
For example:
Display All
Thank you
Martin
Currently, i’m using the Keil-MDK IDE for my projects and i like to use the embedded studio to test my codes with GCC and/or LLVM.
Unfortunately, i need packed structures for the communication with other system. I#m using the ARM Compiler Keyword packed for this.
What would be the right way to declare these structures compiler independent?
For example:
C Source Code
- typedef __packed struct
- {
- __packed union
- {
- __packed struct
- {
- uint32_t component : 4;
- uint32_t unused : 12;
- uint32_t size : 11;
- uint32_t Flag : 1;
- uint32_t typ : 4;
- } Header;
- unsigned long Header32;
- } pkt;
- uint32_t infol[INFOSIZE];
- __packed union
- {
- __packed struct
- {
- uint32_t Data : 16;
- uint32_t subdata : 7;
- uint32_t busy : 1;
- uint32_t Addr : 4;
- uint32_t Cmd : 4;
- } cmdpkt;
- uint32_t Cmd32;
- } Cmd[31];
- } xyz_TypeDef;
Thank you
Martin