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

One AGSI problem

I found that at Timer callback function which started by AGSI SetTimer function, can not reset itself.

sample:

Timer1Handle=CreateTimer(OnTimer1);
SetTimer(Timer1Handle,1024);

void OnTimer1()
{
  SetTimer(Timer1Handle, 1024); //it does not work.
  DoSomething();
}


now ,I must use two timer for continuious timer.

Timer1Handle=CreateTimer(OnTimer1);
SetTimer(Timer1Handle,1024);
Timer2Handle=CreateTimer(OnTimer2);
SetTimer(Timer1Handle,0xFFFFFFFF);

void OnTimer1()
{
  SetTimer(Timer1Handle, 0xFFFFFFFF);
  SetTimer(Timer2Handle, 1024);

  DoSomething();
}

void OnTimer2()
{
  SetTimer(Timer2Handle, 0xFFFFFFFF);
  SetTimer(Timer1Handle, 1024);

  DoSomething();
}

  • I found that at Timer callback function which started by AgsiSetTimer function, but it can not reset itself.

    sample:

    Timer1Handle=AgsiCreateTimer(OnTimer1);
    AgsiSetTimer(Timer1Handle,1024);
    
    void OnTimer1()
    {
      AgsiSetTimer(Timer1Handle, 1024); //it does not work.
      DoSomething();
    }
    

    now ,I must use two timer for continuious timer.

    Timer1Handle=AgsiCreateTimer(OnTimer1);
    AgsiSetTimer(Timer1Handle,1024);
    Timer2Handle=AgsiCreateTimer(OnTimer2);
    AgsiSetTimer(Timer1Handle,0xFFFFFFFF);
    
    void OnTimer1()
    {
      AgsiSetTimer(Timer1Handle, 0xFFFFFFFF);
      AgsiSetTimer(Timer2Handle, 1024);
    
      DoSomething();
    }
    
    void OnTimer2()
    {
      AgsiSetTimer(Timer2Handle, 0xFFFFFFFF);
      AgsiSetTimer(Timer1Handle, 1024);
    
      DoSomething();
    }