mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-08-10 01:23:48 +08:00
introduce sys_timeouts_sleeptime (returns the time left before the next timeout is due, for NO_SYS==1)
This commit is contained in:
@@ -470,7 +470,7 @@ sys_check_timeouts(void)
|
||||
}
|
||||
}
|
||||
/* 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();
|
||||
}
|
||||
|
||||
/** 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 */
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user