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

why the same function can not be called at different place and different time?

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)
              {
              }
              ...
}
}
The function TimeDisp()for displaying time on LCD.Yesterday, place a and b the display function all work well.Today,I change some words in Timer0_ISR but never touch var g_uhour,g_uminute,g_usecond,i discovery that place a g_usecond be changed to a constant while placeb g_usecond always work well. Finally,I define the variable asuchar idata g_uhour,g_uminute,g_usecond;again,the problem be resolved.
can you tell me why?
Best regards,
Nantiangumo.