Keil™, An ARM® Company

RTX51 Tiny User's Guide

os_reset_interval

Summary 
#include <rtx51tny.h>

void os_reset_interval (
  unsigned char ticks);     /* Number of Timer Ticks */
Description 

The os_reset_interval function is used to correct timer problems that occur when the os_wait function is used to wait for K_IVL and K_SIG events simultaneously. In such a case, if a signal (K_SIG) event causes os_wait to exit, the interval timer is not adjusted and subsequent calls to os_wait (to wait for an interval) may not delay for the required time period.

The os_reset_interval routine allows you to reset the interval timer so that subsequent calls to os_wait operate as expected.

Note

  • This function is part of the RTX51 Tiny Real-Time Operating System which is included only with the PK51 Professional Developer's Kit.
Return Value None.
Example 
#include <rtx51tny.h>

void task_func (void) _task_ 4
{
.
.
.
switch (os_wait2 (K_SIG | K_IVL, 100))
  {
  case TMO_EVENT:
    /* Timeout occurred */
    /* os_reset_interval not required */
    break;

  case SIG_EVENT:
    /* Signal received */
    /* os_reset_interval required */
    os_reset_interval (100);
    /* do something with the signal */
    break;
  }
.
.
.
}