mirror of
https://github.com/cesanta/mongoose.git
synced 2025-01-14 09:48:01 +08:00
Enable SNTP in zephyr example
This commit is contained in:
parent
84fe1d87b3
commit
4f5d385e52
@ -10,3 +10,6 @@ build:
|
|||||||
|
|
||||||
flash:
|
flash:
|
||||||
cd $(ZEPHYR_DIR) && west flash
|
cd $(ZEPHYR_DIR) && west flash
|
||||||
|
|
||||||
|
clean:
|
||||||
|
true
|
||||||
|
@ -52,7 +52,6 @@ static void sfn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
|
|||||||
|
|
||||||
static void timer_fn(void *arg) {
|
static void timer_fn(void *arg) {
|
||||||
struct mg_mgr *mgr = (struct mg_mgr *) arg;
|
struct mg_mgr *mgr = (struct mg_mgr *) arg;
|
||||||
return;
|
|
||||||
if (s_sntp_conn == NULL) s_sntp_conn = mg_sntp_connect(mgr, NULL, sfn, NULL);
|
if (s_sntp_conn == NULL) s_sntp_conn = mg_sntp_connect(mgr, NULL, sfn, NULL);
|
||||||
if (s_boot_timestamp < 9999) mg_sntp_send(s_sntp_conn, time(NULL));
|
if (s_boot_timestamp < 9999) mg_sntp_send(s_sntp_conn, time(NULL));
|
||||||
}
|
}
|
||||||
|
@ -2799,7 +2799,7 @@ struct mg_connection *mg_listen(struct mg_mgr *mgr, const char *url,
|
|||||||
c->fn = fn;
|
c->fn = fn;
|
||||||
c->fn_data = fn_data;
|
c->fn_data = fn_data;
|
||||||
mg_call(c, MG_EV_OPEN, NULL);
|
mg_call(c, MG_EV_OPEN, NULL);
|
||||||
MG_DEBUG(("%lu %s", c->id, url));
|
MG_DEBUG(("%lu %s %p", c->id, url, c->fd));
|
||||||
}
|
}
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
@ -198,7 +198,7 @@ struct mg_connection *mg_listen(struct mg_mgr *mgr, const char *url,
|
|||||||
c->fn = fn;
|
c->fn = fn;
|
||||||
c->fn_data = fn_data;
|
c->fn_data = fn_data;
|
||||||
mg_call(c, MG_EV_OPEN, NULL);
|
mg_call(c, MG_EV_OPEN, NULL);
|
||||||
MG_DEBUG(("%lu %s", c->id, url));
|
MG_DEBUG(("%lu %s %p", c->id, url, c->fd));
|
||||||
}
|
}
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user