Hello,
I'm working on a program in CC6.1 and have come across a strange problem that I cannot resolve.
I have a definition of a structure as shown below:
typedef union {
struct {
uint8_t SID;
uint16_t SLFD;
uint32_t Param;
uint8_t Fill;
};
uint8_t byte[1+7];
}TYPE_CAN_SREQ;
Then I fill and call the structure as shown below again:
CAN_SReq.SID = 0xFF;
CAN_SReq.SLFD= 0xAABB;
CAN_SReq.Param = 0x11223344;
CAN_SReq.Fill = 0xDD;
wait(1000);
canTransmit(canREG1, canMESSAGE_BOX8, CAN_SReq.byte);
The problem comes when I actually look at the results in CAN_SReq.byte. The output of this is shown in the image below. There is extra data in byte[1] that shouldn't be there. It's not data from any of the existing variables, so I don't know where it's coming from or how it's getting there. Any help would be much appreciated.