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

interrupt and modular programming

i want to use my interrupt rotine for the different function in different c files;

main.c file

void my_fonction(void);
data unsigned char switch_state ;

void my_interrupr_rotine (void)  IE0_VECTOR using 1 {
switch_state = P1^3;//read switch
}

void main (void){

while(1){
if(switch_state){
//some thing
}
else my_function();


}
}


and another c file

extern data unsigned char switch_state ;

void my_fonction(void){
while (switch_state==0) {
//somethings
}

}


my program enters in my_function, but in this function, the interrupt routine isnt working, what is the solutuion?(or is tehere any solution?) im seraching in google andkeil database "interrupt modular" ,"interrupt extern" "interrupt global" etc. i havent found anything

Parents Reply Children
No data