Hi,
I have the following structure definition:
typedef struct packet_format
{
uchar src; // Packet source address
uchar dest; // Packet destination address
uchar cmd; // Command
uchar dlen; // Data length
uchar data[64]; // Data buffer - must reside on even byte boundary!
} packet;
In the sample code below, "simpkt" is being allocated on an odd byte boundary. Any help is MUCH appreciated! thanks.
void main (void)
{
uchar i; // Work var
uint crc; // CRC work var
uchar ignore = true; // ADC ignore conversion flag
packet * pkt; // i2C packet pointer
#ifdef TEST
uchar dev_rst = false;
volatile uchar inp_mode = 1;
packet simpkt;
struct download_pt *dlpt = (struct download_pt *)&simpkt.data[0];
struct control_pt *ctl = (struct control_pt *)&simpkt.data[0];
uchar docnt = 0;
uchar doch = 1;
uchar aoch = 1;
uint aoval = 0;
uchar aosubtype = OUT_05;
uchar aosm = 0;
uint ctl_tmr = 0;
#endif
.
.
.
}