Introduce mg_timer_expired(). Adopt DHCP and link status to use it

This commit is contained in:
cpq committed 2022-09-03 09:45:19 +01:00
1 parent a113e344a1
commit f9272d0959
5 files changed
+54 -62

No files matched your search

+1 -1
View File
@@ -5,7 +5,6 @@
struct mg_timer {
unsigned long id; // Timer ID
uint64_t period_ms; // Timer period in milliseconds
uint64_t prev_ms; // Timestamp of a previous poll
uint64_t expire; // Expiration timestamp in milliseconds
unsigned flags; // Possible flags values below
#define MG_TIMER_ONCE 0 // Call function once
@@ -21,3 +20,4 @@ void mg_timer_init(struct mg_timer **head, struct mg_timer *timer,
void *arg);
void mg_timer_free(struct mg_timer **head, struct mg_timer *);
void mg_timer_poll(struct mg_timer **head, uint64_t new_ms);
bool mg_timer_expired(uint64_t *expiration, uint64_t period, uint64_t now);