I have a counter variable that increments within a timer ISR. This ISR is in a c file that is build as a static library. Within this project I have a header file which declares the variable extern:
Header File :
extern volatile uint timer2_ISR_ctnr;
C File:
#ifdef TIMERB0
#pragma vector = TIMER2_B0_VECTOR
__interrupt void T2_B0(void)
{
timer2_ISR_cntr++;
LPM3_EXIT;
}
#endif
I am getting the following error when I compile the library:
"../Source/lprs_mspConfig.c", line 160: error #20: identifier "timer2_ISR_cntr" is undefined
I planned on defining the variable in main of another project. Can I not do this? It seems as if I am never defining the variable WITHIN the library project and it is baulking at this....
Thanks