bhengsoh
Newbie level 6

I am having problem with switch case. The program look like this:
It stuck at case 1. Pls hep me to debug this.
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 unsigned char state; void main() { state = 1; } static void interrupt isr() { if(T0IF) { T0IF = 0; TMR0 = -40; switch(state) { case 1: GPIO2 = ~GPIO2; state = 2; break; case 2: GPIO1 = ~GPIO1; state = 1; break; default: ; } } }
It stuck at case 1. Pls hep me to debug this.