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

calling function from different file

i have a problem regarding using timer0 interrupt service routine and calling function. my program will decrement the i and j (static unsigned int) everytime timer0 overflow.

my program working as i wish if both of these function below are in the same file (main.c). but if i move the mINT_TIMER0 to another file (timer.c), my program doesn't work.

in file main.c

static void timer0_isr (void) interrupt 1 {
	mINT_TIMER0();
}

in file timer.c
#pragma NOAREGS
void mINT_TIMER0 (void) {

	TR0 = 0;
	TH0 = (65536-8950)/256;
	TL0 = (65536-8950)%256;
	TR0 = 1;

	i--;
	j--;

}
#pragma AREGS

i couldn't figure out what is wrong with it.

0