osResetTimer function
BOOL osResetTimer(
  HANDLE Handle

A timer handle.

Return value:

TRUE on success or FALSE on failure. Use osGetLastError function to obtain extended error information.


Function reset, but does not stops the timer.

The timer is started with the osSetTimer function and this time it is determined an interval that is the length of the single cycle. A single cycle is an amount of time when the timer state is changed into non-signaled. When the cycle is finished, the timer will be restored to the signaled state.

Cycles can be repeated a specified number of times. After a single cycle, when the timer is reset, a pass counter is incremented.

To start a new cycle, the timer should be reset, what can be performed either by osResetTimer, or it is done automatically. In case of manual-reset timer the new cycle can be started with osResetTimer, and in case of auto-reset timer the new cycle is also started just after the end of the previous one. When many tasks are waiting for auto-reset timer, only one will start after the end of each cycle.

When osResetTimer resets a timer and the actual cycle is not finished, the cycle will be restarted. The restarting means that the cycle will be performed from the beginning. The Pass counter will be incremented only when the cycle is finished. The cycle can be restarted many times. The function fails, when is used on stopped timer. In this case, the last error code is set to ERR_TIMER_NOT_STARTED.

For more information about the timers please refer to timer objectssection.

Function is available only, when the value of OS_USE_TIMER constant is set to 1.

Header file:OS_Timer.h (include OS_API.h)
See also: BOOL, FALSE, HANDLE, osCreateTimer, osGetLastError, osSetTimer, timers, TRUE
SpaceShadow documentation