Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

C: data problem in a struct

Status
Not open for further replies.

alsig

Junior Member level 1
Joined
Jan 17, 2005
Messages
18
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
160
Hi,
I have an embedded system which runs FreeRTOS. I have several applications on top of FreeRTOS and one of them is a message parser. All messages that needs to be sent between the different application have to go through the message parser application.

My problem is the the data varies depending on the which applications communicates and i want to use the same message structure for all the applications. Sometimes the data are simple like chars and ints and other times the data is a struct.

Regards Jens Alsig
 

Ever heard of a union?
Code:
struct msg_ {
  int commonfield;
  union context_ {
    int sharedfield1[16];
    char sharedfield2[64];
  } context;
} msg;
 

    alsig

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top