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 have the follow definitions of my registers :
typedef struct { unsigned int var1; unsigned int var2; unsigned int var3; } test;
#define pTest ((test *) 0x200000FF)
And to access the variables of the structure :
pTest->var1 = 0xAABBCCDD; pTest->var2 = 0xABCDEFAB; pTest->var3 = 0xAAAAAAAA;
I would like to write this definition : "#define pTest ((test *) 0x200000FF)" without the #define directive, so I've tried to write it as follow :
test *pTest; *pTest = 0x200000FF;
But it didn't work, could you help me?
Thanks in advance.
You haven't said what compiler you're using, but I think that all Keil's compilers have some incarnation or other of the _at_ directive for absolute location assignment in 'C' source...
eg, http://www.keil.com/support/man/docs/c51/c51_le_absvarloc.htm
Failing that, look to the Linker...
Shouldn't that be: pTest = 0x200000FF; Not *pTest = 0x200000FF;
??