mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-22 10:30:13 +00:00
Merge pull request #563 from cmorty/etimer_reset_set
Add function etimer_reset_set.
This commit is contained in:
commit
c3f61e2c79
@ -181,6 +181,14 @@ etimer_set(struct etimer *et, clock_time_t interval)
|
|||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
|
etimer_reset_with_new_interval(struct etimer *et, clock_time_t interval)
|
||||||
|
{
|
||||||
|
timer_reset(&et->timer);
|
||||||
|
et->timer.interval = interval;
|
||||||
|
add_timer(et);
|
||||||
|
}
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
void
|
||||||
etimer_reset(struct etimer *et)
|
etimer_reset(struct etimer *et)
|
||||||
{
|
{
|
||||||
timer_reset(&et->timer);
|
timer_reset(&et->timer);
|
||||||
|
@ -114,6 +114,19 @@ CCIF void etimer_set(struct etimer *et, clock_time_t interval);
|
|||||||
*/
|
*/
|
||||||
CCIF void etimer_reset(struct etimer *et);
|
CCIF void etimer_reset(struct etimer *et);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Reset an event timer with a new interval.
|
||||||
|
* \param et A pointer to the event timer.
|
||||||
|
* \param interval The interval before the timer expires.
|
||||||
|
*
|
||||||
|
* This function very similar to etimer_reset. Opposed to
|
||||||
|
* etimer_reset it is possible to change the timout.
|
||||||
|
* This allows accurate, non-periodic timers without drift.
|
||||||
|
*
|
||||||
|
* \sa etimer_reset()
|
||||||
|
*/
|
||||||
|
void etimer_reset_with_new_interval(struct etimer *et, clock_time_t interval);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Restart an event timer from the current point in time
|
* \brief Restart an event timer from the current point in time
|
||||||
* \param et A pointer to the event timer.
|
* \param et A pointer to the event timer.
|
||||||
|
Loading…
Reference in New Issue
Block a user