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) { } ... } }
Have you configured the start address and size of your xdata space in the project options? Does the derivative you use need any special configuration to access all or part of its xdata space?
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 { ... }