diff --git a/CHANGELOG b/CHANGELOG index 343960b3..f6af2448 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -19,6 +19,10 @@ HISTORY ++ New features: + 2010-02-09: Simon Goldschmidt (Simon Kallweit) + * timers.c/.h: Added function sys_restart_timeouts() from patch #7085 + (Restart system timeout handling) + 2010-02-09: Simon Goldschmidt * netif.c/.h, removed loopif.c/.h: task #10153 (Integrate loopif into netif.c) - loopif does not have to be created by the port any more, diff --git a/src/core/timers.c b/src/core/timers.c index 84e933b2..1c52f9db 100644 --- a/src/core/timers.c +++ b/src/core/timers.c @@ -402,6 +402,17 @@ sys_check_timeouts(void) } } +/** Set back the timestamp of the last call to sys_check_timeouts() + * This is necessary if sys_check_timeouts() hasn't been called for a long + * time (e.g. while saving energy) to prevent all timer functions of that + * period being called. + */ +void +sys_restart_timeouts(void) +{ + timeouts_last_time = sys_now(); +} + #else /* NO_SYS */ /** diff --git a/src/include/lwip/timers.h b/src/include/lwip/timers.h index 3268edd2..9c6e4a6c 100644 --- a/src/include/lwip/timers.h +++ b/src/include/lwip/timers.h @@ -79,6 +79,7 @@ void sys_timeout(u32_t msecs, sys_timeout_handler h, void *arg); void sys_untimeout(sys_timeout_handler h, void *arg); #if NO_SYS void sys_check_timeouts(void); +void sys_restart_timeouts(void); #else /* NO_SYS */ void sys_timeouts_mbox_fetch(sys_mbox_t mbox, void **msg); #endif /* NO_SYS */