Exemplo n.º 1
0
/**
 * Check if a timer has expired.
 *
 * This function tests if a timer has expired and returns true or
 * false depending on its status.
 *
 * \param t A pointer to the timer
 *
 * \return Non-zero if the timer has expired, zero otherwise.
 *
 */
int
stimer_expired(struct stimer *t)
{
    //printf("bsp_getSec() = %lu  t->start = %lu  t->interval = %lu result = %d\n\r",bsp_getSec(),t->start,t->interval, SCLOCK_GEQ(bsp_getSec(), t->start + t->interval));
  return SCLOCK_GEQ(bsp_getSec(), t->start + t->interval);
}
Exemplo n.º 2
0
/**
 * Check if a timer has expired.
 *
 * This function tests if a timer has expired and returns true or
 * false depending on its status.
 *
 * \param t A pointer to the timer
 *
 * \return Non-zero if the timer has expired, zero otherwise.
 *
 */
int
stimer_expired(struct stimer *t)
{
  return SCLOCK_GEQ(clock_seconds(), t->start + t->interval);
}
Exemplo n.º 3
0
/**
 * Check if a timer has expired.
 *
 * This function tests if a timer has expired and returns true or
 * false depending on its status.
 *
 * \param t A pointer to the timer
 *
 * \return Non-zero if the timer has expired, zero otherwise.
 *
 */
int16_t
stimer_expired( seconds_timer_ptr t )
{
  return SCLOCK_GEQ(time(NULL), t->start + t->interval);
}