mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-04 23:29:25 +00:00
patch by Chrysn: patch #8704 fix sys_timeouts_sleeptime function
This commit is contained in:
parent
21815a1427
commit
c2f978bd1e
@ -249,6 +249,9 @@ HISTORY
|
||||
|
||||
++ Bugfixes:
|
||||
|
||||
2015-08-18: Chrysn
|
||||
timers.c: patch #8704 fix sys_timeouts_sleeptime function
|
||||
|
||||
2015-07-01: Erik Ekman
|
||||
* puf.c: fixed bug #45454 (pbuf_take_at() skips write and returns OK if offset
|
||||
is at start of pbuf in chain)
|
||||
|
@ -495,10 +495,16 @@ sys_restart_timeouts(void)
|
||||
u32_t
|
||||
sys_timeouts_sleeptime(void)
|
||||
{
|
||||
u32_t diff;
|
||||
if (next_timeout == NULL) {
|
||||
return 0xffffffff;
|
||||
}
|
||||
return (sys_now() - timeouts_last_time) + next_timeout->time;
|
||||
diff = sys_now() - timeouts_last_time;
|
||||
if (diff > next_timeout->time) {
|
||||
return 0;
|
||||
} else {
|
||||
return next_timeout->time - diff;
|
||||
}
|
||||
}
|
||||
|
||||
#else /* NO_SYS */
|
||||
|
Loading…
Reference in New Issue
Block a user