Hi,
I defined,
Uint16 TCounts[10]; in globals.h
and tried to use it in cc01drv.c where #include "globals.h" is there.
but during build the error msg coming up is, "C202 undefined identifier"
Why this is happening, I haven't initialize the array.
I realized I need to declare the variable twice like, #ifdef _MAIN_ Float32 eedata; #else extern Float32 eedata; Now, it is compiling. I need to understand it furthur details later.
But now I am facing other issue. I am trying to store the ADC readings in an array. Original decleration is,
Globals.h extern volatile unsigned int xdata TCounts; /* store for raw ADC readings*/
Now I declared, globals.h extern Uint16 RawTCounts[10];
Interrupt handlers I defined a 1 sec clock and tried to store TCounts every sec, rolling FIFO type.
RawCounts[n]=TCounts;
With output commands I found RawTCounts[n] values are far way from TCounts, like TCounts is 9359h and RawTCounts[0]= 4710h and no movement at all. Being an Electronic Engineer I don't what I'm missing!! I put the assignment command inside the calc.c function where original TCounts were used then moved it to interrupt handler thinking it might miss the Flag etc.