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

ARTX os_itv_wait breaks if execution takes longer than os_itv_set

If I setup a interval wait timer for 100 clock ticks ,os_itv_set(100), and the execution from the os_itv_set(100) to the os_itv_wait() takes longer than 100 clock ticks, the os_itv_wait() waits for 65535 clock ticks.

Is there a way that I can check the clock ticks remaining prior to calling os_itv_wait()?


 #include <ARTX.h>

void task1 (void) __task {
    .
    .
   os_itv_set (100);
   for (;;) {
     .
     .
     /* execution may take longer than 100 clock ticks */
     os_itv_wait (); /* if 100 clock ticks have passed */
                     /* this will wait for 65535 clock */
                     /* ticks.                         */
   }
}

0