Hi,
entire web is full of explanation how to use global variables in C.
However, when I want to use variable defined in some module (let's say file1.c) as global and make it visible to other modules then I define it in the file1.h as extern and as global in the module file1.c.
file1.h: extern UBYTE var1;
file1.c: UBYTE var 1 = 10;
This approach I use when the variable is closely connected to given module functionality and I want to create connection of its global variables to other modules.
However, if I have some variables I want to be global for each module..like program setup values, general counters,....then I create extra globalDefs.c and GlobalDefs.h where I create such variables (myCounter in the example in module myfile1.c/h).
I have attached an example you can step through and look into variables window which variable is processed.
(Of course, the CodeWarrior provides some simplification in usage of keyword extern but I use it to inform myself I did everything and know how the variable will be used)
The main problem, I think, in your project is a multiply initialization of commonly used global variables as a part of definition.
Best regards,
Ladislav