From: <Gil...@rt...> - 2001-01-29 07:15:08
|
Hi all, I am having trouble from the following interrupt routine=2E The code=20= inside the if statement is behaving erratically=2E Sometime the code=20= inside the if statement is always executed no matter what=2E volatile unsigned char alarm_set_flag =3D 0; //flag if alarm engaged void timer0_isr(void) interrupt 1 using 1 { timers(); } #pragma SAVE #pragma NOOVERLAY void timers() critical {=20= TL0 =3D (TIMER0COUNT & 0x00FF); //timer reload value TH0 =3D (TIMER0COUNT >> 8); if(alarm_set_flag) //if alarm is engaged {=20= code=2E=2E=2E=2E=2E=2E } } #pragma RESTORE |