I have a timer ISR defined in a library with a counter variable incrementing. The header file that accompanies the library declares the variable as extern volatile.
In a second project I have an application that defines the variable volatile and sets it = 0 outside of main (globally).
All code compiles and links.
main test code(See below):
volatile uint timer2_ISR_cntr = 0;
int main(void)
{
struct confTimer radioT;
WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer
strcpy(radioT.name, "B0");
strcpy(radioT.direction, "up");
radioT.countValue = 4555;
if (!config_timer(&radioT));
run_timer(&radioT);
while (1) {
__bis_SR_register(LPM3_bits + GIE);
if (timer2_ISR_cntr >= 10)
timer2_ISR_cntr = 0;
}
}
Pretty simple....I configure counter, then go to sleep....I expect that variable will increase bcz it is set to do so within the library compiled ISR. I can see that the counter is incrementing and loading according to my code however I never see the variable incrementing when I put a watch on it in the Expression window. Along with this when I stop the code from running I jump into isr_trap.asm??
Can someone give me ideas as to why?
..btw TB0CCTL0 CCIE is set
Thanks