AnsweredAssumed Answered

'struct' size problem

Question asked by sebasira on May 28, 2013
Latest reply on May 28, 2013 by sebasira



I'm used to work with structures, my whole application is based on them. Now I'm porting this 'old' app from HCS12 to K60... It's a HUGE change but it is not far for being over.


I've got a structure defined like this:


typedef struct{

      word mov;

      byte addressRx;

      byte addressTx;

      byte tipoReloj;

      byte empty[3];        // 3 empty bytes so the whole size is 4bytes-aligned



The problem is that every parameter inside this structure has a size of 4bytes instead of 2bytes for 'word' and 1byte for 'byte'. In HCS12 wich is a 16bit MCU I don't have this problem but I do in K60 wich is 32bits.

What can I do so the size of each parameter would be as expected?

Thanks in advance!!!

Best Regards,