mirror of
https://github.com/ep00ch/lwip-contrib-mac.git
synced 2024-07-07 20:29:04 +00:00
Improved timer accuracy with NO_SYS=1
This commit is contained in:
parent
1d7b5a1c9a
commit
7c9fe43805
@ -281,12 +281,12 @@ void main_loop()
|
|||||||
/* execute TCP fast timer every 250 ms */
|
/* execute TCP fast timer every 250 ms */
|
||||||
if (timerTcpFast > TCP_TMR_INTERVAL) {
|
if (timerTcpFast > TCP_TMR_INTERVAL) {
|
||||||
tcp_fasttmr();
|
tcp_fasttmr();
|
||||||
timerTcpFast = 0;
|
timerTcpFast -= TCP_TMR_INTERVAL;
|
||||||
}
|
}
|
||||||
/* execute TCP slow timer every 500 ms */
|
/* execute TCP slow timer every 500 ms */
|
||||||
if (timerTcpSlow > ((TCP_TMR_INTERVAL)*2)) {
|
if (timerTcpSlow > ((TCP_TMR_INTERVAL)*2)) {
|
||||||
tcp_slowtmr();
|
tcp_slowtmr();
|
||||||
timerTcpSlow = 0;
|
timerTcpSlow -= (TCP_TMR_INTERVAL)*2;
|
||||||
done = _kbhit();
|
done = _kbhit();
|
||||||
}
|
}
|
||||||
#endif /* LWIP_TCP */
|
#endif /* LWIP_TCP */
|
||||||
@ -294,43 +294,43 @@ void main_loop()
|
|||||||
/* execute ARP timer */
|
/* execute ARP timer */
|
||||||
if (timerArp > ARP_TMR_INTERVAL) {
|
if (timerArp > ARP_TMR_INTERVAL) {
|
||||||
etharp_tmr();
|
etharp_tmr();
|
||||||
timerArp = 0;
|
timerArp -= ARP_TMR_INTERVAL;
|
||||||
}
|
}
|
||||||
#endif /* LWIP_ARP */
|
#endif /* LWIP_ARP */
|
||||||
#if LWIP_DHCP
|
#if LWIP_DHCP
|
||||||
/* execute DHCP fine timer */
|
/* execute DHCP fine timer */
|
||||||
if (timerDhcpFine > DHCP_FINE_TIMER_MSECS) {
|
if (timerDhcpFine > DHCP_FINE_TIMER_MSECS) {
|
||||||
dhcp_fine_tmr();
|
dhcp_fine_tmr();
|
||||||
timerDhcpFine = 0;
|
timerDhcpFine -= DHCP_FINE_TIMER_MSECS;
|
||||||
}
|
}
|
||||||
/* execute DHCP coarse timer */
|
/* execute DHCP coarse timer */
|
||||||
if (timerDhcpCoarse > DHCP_COARSE_TIMER_SECS*1000) {
|
if (timerDhcpCoarse > ((DHCP_COARSE_TIMER_SECS)*1000)) {
|
||||||
dhcp_coarse_tmr();
|
dhcp_coarse_tmr();
|
||||||
timerDhcpCoarse = 0;
|
timerDhcpCoarse -= DHCP_COARSE_TIMER_SECS*1000;
|
||||||
}
|
}
|
||||||
#endif /* LWIP_DHCP */
|
#endif /* LWIP_DHCP */
|
||||||
#if IP_REASSEMBLY
|
#if IP_REASSEMBLY
|
||||||
/* execute IP reassembly timer */
|
/* execute IP reassembly timer */
|
||||||
if (timerIpReass > IP_TMR_INTERVAL) {
|
if (timerIpReass > IP_TMR_INTERVAL) {
|
||||||
ip_reass_tmr();
|
ip_reass_tmr();
|
||||||
timerIpReass = 0;
|
timerIpReass -= IP_TMR_INTERVAL;
|
||||||
}
|
}
|
||||||
#endif /* IP_REASSEMBLY*/
|
#endif /* IP_REASSEMBLY*/
|
||||||
#if LWIP_AUTOIP
|
#if LWIP_AUTOIP
|
||||||
/* execute AUTOIP timer */
|
/* execute AUTOIP timer */
|
||||||
if (timerAutoIP > AUTOIP_TMR_INTERVAL) {
|
if (timerAutoIP > AUTOIP_TMR_INTERVAL) {
|
||||||
autoip_tmr();
|
autoip_tmr();
|
||||||
timerAutoIP = 0;
|
timerAutoIP -= AUTOIP_TMR_INTERVAL;
|
||||||
}
|
}
|
||||||
#endif /* LWIP_AUTOIP */
|
#endif /* LWIP_AUTOIP */
|
||||||
#if LWIP_IGMP
|
#if LWIP_IGMP
|
||||||
/* execute IGP timer */
|
/* execute IGP timer */
|
||||||
if (timerIgmp > IGMP_TMR_INTERVAL) {
|
if (timerIgmp > IGMP_TMR_INTERVAL) {
|
||||||
igmp_tmr();
|
igmp_tmr();
|
||||||
timerIgmp = 0;
|
timerIgmp -= IGMP_TMR_INTERVAL;
|
||||||
}
|
}
|
||||||
#endif /* LWIP_IGMP */
|
#endif /* LWIP_IGMP */
|
||||||
/* TODO: execute other timers... */
|
|
||||||
#endif /* NO_SYS */
|
#endif /* NO_SYS */
|
||||||
|
|
||||||
/* check for packets */
|
/* check for packets */
|
||||||
|
Loading…
Reference in New Issue
Block a user