mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-07-04 20:08:57 +00:00
introduce sys_timeouts_sleeptime (returns the time left before the next timeout is due, for NO_SYS==1)
This commit is contained in:
parent
80b62df0a9
commit
7a0f814043
|
@ -6,6 +6,10 @@ HISTORY
|
||||||
|
|
||||||
++ New features:
|
++ New features:
|
||||||
|
|
||||||
|
2015-02-12: chrysn
|
||||||
|
* timers.h/.c: introduce sys_timeouts_sleeptime (returns the time left before
|
||||||
|
the next timeout is due, for NO_SYS==1)
|
||||||
|
|
||||||
2015-02-11: Nick van Ijzendoorn
|
2015-02-11: Nick van Ijzendoorn
|
||||||
* opt.h, sockets.h/c: patch #7702 "Include ability to increase the socket number
|
* opt.h, sockets.h/c: patch #7702 "Include ability to increase the socket number
|
||||||
with defined offset"
|
with defined offset"
|
||||||
|
|
|
@ -470,7 +470,7 @@ sys_check_timeouts(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* repeat until all expired timers have been called */
|
/* repeat until all expired timers have been called */
|
||||||
}while(had_one);
|
} while(had_one);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -485,6 +485,18 @@ sys_restart_timeouts(void)
|
||||||
timeouts_last_time = sys_now();
|
timeouts_last_time = sys_now();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Return the time left before the next timeout is due. If no timeouts are
|
||||||
|
* enqueued, returns 0xffffffff
|
||||||
|
*/
|
||||||
|
u32_t
|
||||||
|
sys_timeouts_sleeptime(void)
|
||||||
|
{
|
||||||
|
if (next_timeout == NULL) {
|
||||||
|
return 0xffffffff;
|
||||||
|
}
|
||||||
|
return (sys_now() - timeouts_last_time) + next_timeout->time;
|
||||||
|
}
|
||||||
|
|
||||||
#else /* NO_SYS */
|
#else /* NO_SYS */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -87,6 +87,7 @@ void sys_untimeout(sys_timeout_handler handler, void *arg);
|
||||||
#if NO_SYS
|
#if NO_SYS
|
||||||
void sys_check_timeouts(void);
|
void sys_check_timeouts(void);
|
||||||
void sys_restart_timeouts(void);
|
void sys_restart_timeouts(void);
|
||||||
|
u32_t sys_timeouts_sleeptime(void);
|
||||||
#else /* NO_SYS */
|
#else /* NO_SYS */
|
||||||
void sys_timeouts_mbox_fetch(sys_mbox_t *mbox, void **msg);
|
void sys_timeouts_mbox_fetch(sys_mbox_t *mbox, void **msg);
|
||||||
#endif /* NO_SYS */
|
#endif /* NO_SYS */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user