Posted: Sun Dec 29, 2002 10:33 pm
Restored from previous forum. Originally posted by ebs.
Can someone please give me an example of how to use a StructureUnion? I use unions in C all the time, but the PB syntax has me baffled. I want to create the PB equivalent to this C union:
typedef union
{
unsigned int CRC;
unsigned int LOW:8;
unsigned int HIGH:8;
} CRC16;
In other words, I want a 16-bit integer and two 8-bit bytes to share the same memory location, so I can manipulate the CRC16 type as one integer or two bytes.
Thank you!
Can someone please give me an example of how to use a StructureUnion? I use unions in C all the time, but the PB syntax has me baffled. I want to create the PB equivalent to this C union:
typedef union
{
unsigned int CRC;
unsigned int LOW:8;
unsigned int HIGH:8;
} CRC16;
In other words, I want a 16-bit integer and two 8-bit bytes to share the same memory location, so I can manipulate the CRC16 type as one integer or two bytes.
Thank you!