This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How can I use a global variable in the Interrupt routine?

The variable is defined in *.h:

static unsigned char cPwLe[3] = {0};

Its value is changed in the Main():
cPwLe[cCh] = Power_Level(cP[cCh]);  //Here  value is right

Its value is transfered to T0 Interrutpt service routine:
cPower = cPwLe[cCh]; //Here value is  always 0

How can I correct the errors?
Thanks all!

0