main.c uchar xdata g_uhour,g_uminute,g_usecond; void TimeDisp(uchar h,uchar m,uchar s) { ... } void main(void) { ... while(1) { if (page==0) { ... TimeDisp(g_uhour,g_uminute,g_usecond);//a } else if (page ==1) { ... TimeDisp(g_uhour,g_uminute,g_usecond);//b } else if (page==2) { } ... } }
Hi. You must using this function with reentrant attribute. Now its OK! You may call this function whenever.... Example.
void TimeDisp(uchar h,uchar m,uchar s) reentrant { ... }