stimer_reset: do not do anything if the timer has not expired
@@ -77,7 +77,8 @@ stimer_set(struct stimer *t, unsigned long interval)
* given to the stimer_set() function. The start point of the interval
* is the exact time that the timer last expired. Therefore, this
* function will cause the timer to be stable over time, unlike the
- * stimer_restart() function.
+ * stimer_restart() function. If this is executed before the
+ * timer expired, this function has no effect.
*
* \param t A pointer to the timer.
*
@@ -86,8 +87,10 @@ stimer_set(struct stimer *t, unsigned long interval)
void
stimer_reset(struct stimer *t)
{
+ if(stimer_expired(t)) {
t->start += t->interval;
}
+}
/*---------------------------------------------------------------------------*/
/**
* Restart the timer from the current point in time
