AnsweredAssumed Answered

Byte Order in Struct

Question asked by Ray Hall on Jul 4, 2015
Latest reply on Jul 7, 2015 by Ray Hall

struct TestStruct {

   uint16_t itemOne;

   uint16_t itemTwo;

   uint16_t itemThree;

   uint16_t itemFour;

}test;

 

 

test.itemOne = 1000;

test.itemTwo = 1001;

test.itemThree = 1002;

test.itemFour = 1003;

 

 

The values are stored with LSB First. All other MCU I have used

and C++ Builder store the values MSB First. This has made simple

coding into more complicated as I have to swap the bytes before I

can use them when they are transferred to and from the PC software..

 

I am using the S12G128 if that matters.

 

How do I make CodeWarrior stop doing this.

 

Ray.

Outcomes