Hi Mark,
I found out how to do two things: turn on checking for structures being padded and how to ensure the structure parameters are packed. I haven't found out how to globally set the packing option.
The below #if has comments to explain.
#if
1 //DES test for customer MarkP from forums
#pragma
warn_padding on //turns on warning but have to visually check if you get a warning...other settings [off | reset].
typedef
struct{
volatileuint_8channel__attribute__((aligned (1))); //DES changing 1 to a 4 and recompile to see warning
volatileuint_16value__attribute__((aligned (1))); //DES not really needed but if you were to add to struct handy to already have in code
}
ADC_Value_t;
#endif
Warning in console when aligned(4):
(C:\Freescale\FreescaleMQX3.7\mqx\examples\adc\adc_demo.c|158|1|11|6463|11)
=}ADC_Value_t;
>1 pad byte(s) inserted after data member 'value'
Alternatively you could turn on the Pad Bytes Added (full) option in the ARM compiler Warnings settings and you will see a number of struct warnings about bytes being padded.
Hope this helps.
Regards,
David