Hi,
I ran into an interesting situation when assigning to a pointer using CCS4 for the MSP430F5529. Here's what I attempted to do:
BYTE buffer[3];
UINT16 value = 0x05B2;
buffer[0] = 0x01;
*((UINT16*)&_buffer[1]) = value;
What I expected was that the following would be true:
buffer[0] == 0x01
buffer[1] == 0xB2
buffer[2] == 0x05
What I actually got was:
buffer[0] == 0xB2
buffer[1] == 0x05
buffer[2] == garbage
What am I missing?
Thanks.