#include <mega8535.h>#include <alcd.h>#include <delay.h>// External Interrupt 0 service routine
interrupt [EXT_INT0]void ext_int0_isr(void){
x=1;// when int0 pressed x =1}
interrupt [EXT_INT1]void ext_int1_isr(void){
x=2;}int x;// global variable declarationvoid main(void){if(x=1){
lcd_putsf('int0');}elseif(x==2){
lcd_putsf('int1');}}
this is the format of the code am getting an error that ISR can't recognize the variable 'x', it shows undefined variable . i used code vision avr how can i resolve this issue
i declared the variable 'x' before void main function, even after that am getting the same error, you can see that a variable 'x' is declared before the void main function .
please provide the code with proper variable declaration , so that i can understand the cause for the error , am using code vision avr for programming .