Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/22/03 05:23
Read: times


 
#53072 - wrong code in interrupt routine
hi,can anyone tell me why the last line code
( if(KeyCode==8) {BackLight = !BackLight;F0=0;} )
is wrong? if i remove the last line,everything seems
ok. if i leave it in this routine, i don\'t know where
the program will goes to after the interrupt?




sbit BackLight=P3^4;
char KeyCode=0 ;

void KeyPress(void) interrupt 2
{
KeyCode = P0;
KeyCode = KeyCode&0x0f;
F0=1;
if(KeyCode==8) {BackLight = !BackLight;F0=0;}

}



List of 5 messages in thread
TopicAuthorDate
wrong code in interrupt routine            01/01/70 00:00      
   RE: wrong code in interrupt routine            01/01/70 00:00      
      RE: wrong code in interrupt routine            01/01/70 00:00      
      RE: Keil use of F0, F1 - Michael            01/01/70 00:00      
         RE: Keil use of F0, F1 - Michael            01/01/70 00:00      

Back to Subject List