Announcement

Collapse
No announcement yet.

Get/Set_Timer()

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Get/Set_Timer()

    I have noticed that the docs on the get/set_Timer() functions are not accurate or at least not complete. If I run this code:
    HTML Code:
    repeat
    sys_SetTimer(TIMER0,30000);
    
    while(sys_GetTimer(TIMER0)>0)
    wend
    snd_Volume(10);
    file_PlayWAV("207.wav");
    while ( (n := snd_Playing()) )
    wend
    forever
    
    I get a beep every 30 seconds.
    
    If I run the following code:
    
    sys_SetTimer(TIMER0,32768);
    
    while(sys_GetTimer(TIMER0)>0)
    wend
    snd_Volume(10);
    file_PlayWAV("207.wav");
    while ( (n := snd_Playing()) )
    wend
    I get non-stop beeping.
    The docs claim you can enter 65535 and expect a 65.535 second timeout period. This does not appear to be the case. Anything over 32767 in the set_Timer value causes the function to always return zero.
    Anyone know if a fix is in the works?

    Thad
    If email spam were the edible Spam, there would be no world hunger.

  • #2


    Hello,

    I have same bug.
    Have you find a solution, without use a variable ?

    Thanks.

    Comment


    • #3


      The bug is in his code.. Since numbers are signed he should be saying

      while(sys_GetTimer(TIMER0)!=0)
      Mark

      Comment


      • #4


        Thank you
        effectively with the condition " != " the program works.

        Comment

        Working...
        X