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.
hi,
I have a program which is divided into 4 banks each of 32KBytes...
Now in the common area(main.c) i have delared a struct as following..
main.c struct foo { float a; char b; }; xdata struct foo foo1; void main() { foo1.a = 12.3; }
i have externed this struct in the main header file as below..
main.h struct foo { float a; char b; }; extern xdata struct foo foo1;
now i included the main.h in bank1 (bank1.c) and use the struct as normal i.e number = foo1.a ;
now the wierdest part is whenever i check the structure foo1.a value in bank1.c its blank...the debugger show me no value.
Wat could be the problem... the above was just an example..the original code has high memory usage, the structure also is very big and I have used xdata overlaying(large keyword) in some functions.
You should not describe the foo struct multiple times. Skip the one in main.c - any user of your variable foo1 should include main.h.