We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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
thank you very much ! my program now working, i am using header files, also the problem was in the one of this header files one my variable structure; xdata volatile PSD_REGS PSD_reg _at_ PSD_REG_ADDR; and its extern line at header file is; extern xdata PSD_REGS PSD_reg _at_ PSD_REG_ADDR; when i writing ,i forgot volatile keyword, (i think may be optimiser didnt take care of on switch port changing whitout volatile (port d which is contrlled by PSD_REGS )) and i didnt see this very long time. i cant paste all my code here becouse the program nearly 700 line, if i can paste here , most probably you can see the wrong line, in one minute:) thanks