Hello
Well there are several problems in this code snippet.
1- If the variable is defined a static in the file globals.c, it will not be visible outside of that module.
So if you want to use that variable in another module remove the static modifier in front of the
variable definition in globals.c
2- If the variable has a structured type, this type should be known from all module using that variable.
I would suggest you the following:
1- Define a file globals.h, where you define a typedef for the structured type. It is also good practice
(or programming style) to insert the external declaration for the variable in this module.
For example:
typedef struct
{
int16 nHarmonics;
int16 HIndex[16];
uint16 HAmplitude[16];
uint16 HPhase[16];
}t_stWaveforms;
extern t_stWaveforms g_stWaveforms[];
2- Include globals.h in globals.c and define the variable there.
For Example
#include "globals.h"
t_stWaveforms g_stWaveforms[6];
3- Include globals.h in each C source file where you want to use the variable g_stWaveforms.
Note that this is all standard ANSI C modular programming rules. You may also refer to your favorite ANSI C reference manual for more information around that subject.
I hope that helps.
CrasyCat