I want an instance of a structure to be put at a specific address in xdata. What is the difference between these declarations:
#define tSetupPacket (* (tDEVICE_REQUEST xdata *)0xFF00) tDEVICE_REQUEST xdata tSetupPacket _at_ 0xFF00;
"It seems that the second behaves incorrectly." in what way?
All the fields of the setup packed defined by the second declaration are zeroes, while they are not. There is 1 more reason to love the first declaration style. These declarations can be used in H file. This means no extern import is required in C modules. Unfortunately I've faced a problem. I cannot declire an array using this style, i.e. the following does not compile: #define InEndpoints (* (tEDB[3] xdata *)0xFF48) where tEDB is a structure. Can you help me?