I thought you figured how to make it compileable without warning, using __XGATE__ define. Something like that.
#ifndef __XGATE__
#pragma align on
#endif
typedef union uHL2Byte {
word _word;
struct { byte msb; byte lsb; }_byte;
} tHL2Byte;
typedef union u4Long {
long dWord;
struct { tHL2Byte msw; tHL2Byte lsw; } _word;
} t4Long;
typedef struct _Measuring_Device_data
{
tHL2Byte addres;
byte number;
byte length;
char sign:1;
t4Long value;
} Measuring_Device_data;
// and probably declare some extern data
extern Measuring_Device_data data;
#ifndef __XGATE__
#pragma align off
#endif
Then in one of source files you include the header and define (allocate) you data:
Measuring_Device_data data;
I again was not clear. I meant that this code doesn't work in CW4.6. Having sign member defined as char sign:1; , or as int sign:1; , value member offset is +5 in S12X part, and +6 in XGATE! Try filling structure from S12X, then reading it from XGATE.
And with sign member defined as char sign, or as int sign, both structures are aligned absolutely the same, and sharing between XGATE and S12X works properly.
Message Edited by kef on
2008-10-23 03:29 PM