We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I'm using the Keil uVision3. How do I pack structs?
Do I use __packed or is there a pragma?
is this correct? it doesn't compile...
typedef struct { UINT8 key_diff; UINT8 key_state; } __packed SCmd_KeyPress;
A non-C51 comment: using the __packed directive will cause massive performance loss, as the compiler must take into account the data might not be aligned! don't, unless you really have to...